enigma-cli 1.6.6 → 1.6.7

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
@@ -146,23 +146,27 @@ removed.
146
146
  ## Token-efficient output
147
147
 
148
148
  Optionally compress the agent's chat prose to cut output tokens while keeping
149
- full technical accuracy (inspired by [caveman](https://github.com/JuliusBrussee/caveman)).
150
- Chosen at install or via config; off by default:
149
+ full technical accuracy. Chosen at install or via config; off by default:
151
150
 
152
151
  ```bash
153
152
  enigma config output-style lite # professional terse (drop filler, keep grammar)
154
- enigma config output-style full # caveman-style fragments
153
+ enigma config output-style full # shorter, drops articles and uses fragments
155
154
  enigma config output-style ultra # telegraphic, maximum compression
156
155
  enigma config output-style off # back to full prose (default)
157
156
  enigma install --output-style lite # set it during install
158
157
  ```
159
158
 
160
- `on`/`off` also work (`on` = `full`, caveman's default). Like the toggle above it edits the memory
159
+ `on`/`off` also work (`on` = `full`). Like the toggle above it edits the memory
161
160
  file, so **restart your agent** after changing it. Code, comments, commits, and
162
161
  PRs stay normal, the agent reverts to full prose for security warnings and other
163
162
  safety-critical replies, and the level is switchable mid-session by asking
164
163
  ("be more terse", "ultra", "normal mode").
165
164
 
165
+ While the mode is active, Claude Code's status bar shows an `[ENIGMA]` badge
166
+ (`[ENIGMA:LITE]` / `[ENIGMA:ULTRA]` for the other levels). enigma wires this on
167
+ install only if you have no status line configured, and the badge disappears when
168
+ you turn the mode off.
169
+
166
170
  ## License
167
171
 
168
172
  [Apache-2.0](LICENSE).
@@ -3,6 +3,6 @@
3
3
  "version": "1.0.0",
4
4
  "provider": "FJRG2007/enigma",
5
5
  "description": "Backend/API architecture: controller-service-repository layering, API and request optimization, server-side caching (Redis), and Zod boundary validation.",
6
- "cliVersion": "1.6.6",
6
+ "cliVersion": "1.6.7",
7
7
  "sha": "c442bc9e39a7710cb709ef2abb8d15ecd8aa16ed4f5c8af92b7af6877401cba4"
8
8
  }
@@ -3,6 +3,6 @@
3
3
  "version": "1.1.1",
4
4
  "provider": "FJRG2007/enigma",
5
5
  "description": "Ciphera code style conventions (formatting, naming, imports, comments, code-level anti-patterns; TypeScript-first, language-agnostic).",
6
- "cliVersion": "1.6.6",
6
+ "cliVersion": "1.6.7",
7
7
  "sha": "74f638aec13e8c93257fe1ad604c28b07e9a7c456796a4ceefcc99217d9e7039"
8
8
  }
@@ -3,6 +3,6 @@
3
3
  "version": "1.0.0",
4
4
  "provider": "FJRG2007/enigma",
5
5
  "description": "Pre-delivery self-review gate, prioritized review dimensions, and change-quality criteria.",
6
- "cliVersion": "1.6.6",
6
+ "cliVersion": "1.6.7",
7
7
  "sha": "3d3bbe0602d5bbb4afe37648fe3c2fa39376b1bcbac5d8c441f01fad1e866ed0"
8
8
  }
@@ -3,6 +3,6 @@
3
3
  "version": "1.4.0",
4
4
  "provider": "FJRG2007/enigma",
5
5
  "description": "Core engineering execution policy and harness orchestration (highest-authority rules).",
6
- "cliVersion": "1.6.6",
6
+ "cliVersion": "1.6.7",
7
7
  "sha": "c9c69c59516794311cb7b306ed4d4ad971824de3689a39c2b86c7669c73f2e8b"
8
8
  }
@@ -19,12 +19,23 @@ description: Senior database architecture - schema design, normalization and ant
19
19
  2. NEVER duplicate data, unless the value is expensive to compute AND the use case justifies persisting it.
20
20
  3. ALWAYS encrypt data that legally or contractually requires it (RGPD/GDPR and equivalents).
21
21
  4. ALWAYS design for large-scale growth: optimal, scalable, fast, and secure by default.
22
+ 5. ALWAYS use UUID primary keys and identifiers; NEVER use auto-increment, serial, or IDENTITY integer IDs.
22
23
 
23
- - These four directives take priority over convenience or speed of implementation.
24
+ - These five directives take priority over convenience or speed of implementation.
24
25
  - If a request conflicts with them, surface the conflict and propose the compliant alternative before proceeding.
25
26
 
26
27
  ---
27
28
 
29
+ ## Identifier Policy (Non-Negotiable)
30
+
31
+ - Every primary key and every externally exposed identifier MUST be a UUID. NEVER use auto-increment, SERIAL, BIGSERIAL, IDENTITY, AUTO_INCREMENT, or any incrementing integer/sequence as an entity ID - no exceptions, in any datastore.
32
+ - Prefer monotonic UUIDv7 or ULID for index locality and write performance; use random UUIDv4 only when unpredictability matters more than locality. Store IDs in a native UUID type (or 16-byte binary), not a formatted string column where the engine offers UUID.
33
+ - Why: sequential integer IDs are enumerable (IDOR/scraping risk), leak row counts and growth rate, and collide across shards, replicas, and offline/merge flows. UUIDs can be generated client-side before insert and stay unique across distributed systems.
34
+ - Generate the identifier at the application/domain layer (or via a database UUID default) so an entity owns its identity before it is persisted.
35
+ - Natural/business keys may still back UNIQUE constraints, but the surrogate primary key is always a UUID.
36
+
37
+ ---
38
+
28
39
  ## Rule Priority Hierarchy
29
40
 
30
41
  When database rules conflict, apply this order:
@@ -81,8 +92,7 @@ Any denormalized or duplicated value MUST have:
81
92
 
82
93
  - Design the schema around the real access patterns, not only the entity model.
83
94
  - Choose correct, minimal data types (smallest type that safely fits; native date/time, numeric, boolean, UUID, enum types).
84
- - Use surrogate keys (BIGINT identity / UUIDv7 or ULID for distributed inserts) where natural keys are unstable or wide.
85
- - Prefer monotonic keys (UUIDv7/ULID) over UUIDv4 for write locality and index health.
95
+ - The surrogate primary key is always a UUID (see Identifier Policy) - never an auto-increment/IDENTITY integer; prefer monotonic UUIDv7 or ULID over random UUIDv4 for write locality and index health.
86
96
 
87
97
  ### Indexing Rules
88
98
 
@@ -200,6 +210,7 @@ Any denormalized or duplicated value MUST have:
200
210
 
201
211
  ## Anti-Patterns (Never Do)
202
212
 
213
+ - Using auto-increment / serial / IDENTITY integer primary keys, or exposing sequential numeric IDs instead of UUIDs.
203
214
  - Duplicating data without a documented sync strategy and justification.
204
215
  - Storing easily computable values that should be derived at read time.
205
216
  - SELECT * on hot paths or fetching columns that are not used.
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "database-expert",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "provider": "FJRG2007/enigma",
5
5
  "description": "Senior database architecture policy: query optimization, anti-duplication/normalization, scalability, and RGPD/GDPR encryption.",
6
- "cliVersion": "1.6.6",
7
- "sha": "c4617ee8d1a57d9621c81bef3093e94de91f79eec0cc0ead41f6d18dd443e623"
6
+ "cliVersion": "1.6.7",
7
+ "sha": "2883bcecb3202683ae6f81b073c3d6a9cec9c55029e011bdd06ba7ac3537297e"
8
8
  }
@@ -3,6 +3,6 @@
3
3
  "version": "1.0.0",
4
4
  "provider": "FJRG2007/enigma",
5
5
  "description": "Reproduce-isolate-fix debugging methodology with root-cause discipline and regression verification.",
6
- "cliVersion": "1.6.6",
6
+ "cliVersion": "1.6.7",
7
7
  "sha": "14b0064c8b33a0dc85e51464b05005cf5801c756b1101789a6924b9548420f6b"
8
8
  }
@@ -3,6 +3,6 @@
3
3
  "version": "1.0.0",
4
4
  "provider": "FJRG2007/enigma",
5
5
  "description": "Dependency and supply-chain security: lockfiles and reproducible installs, version pinning, vulnerability auditing, vetting/minimizing packages, vendoring, and SBOM/provenance.",
6
- "cliVersion": "1.6.6",
6
+ "cliVersion": "1.6.7",
7
7
  "sha": "6375d835c2aef2c9bd31ce116444dc3d796f510f9970a213aa3ac4696d7e21b9"
8
8
  }
@@ -3,6 +3,6 @@
3
3
  "version": "1.1.0",
4
4
  "provider": "FJRG2007/enigma",
5
5
  "description": "Frontend architecture: reusable components, abstraction thresholds, state management, and optimistic UI with rollback.",
6
- "cliVersion": "1.6.6",
6
+ "cliVersion": "1.6.7",
7
7
  "sha": "33fa1e9f667ef26203a3d6c892121efe12b0cddb706c195492fa97e080fba115"
8
8
  }
@@ -3,6 +3,6 @@
3
3
  "version": "1.2.0",
4
4
  "provider": "FJRG2007/enigma",
5
5
  "description": "Git & contribution policy (senior engineering standards).",
6
- "cliVersion": "1.6.6",
6
+ "cliVersion": "1.6.7",
7
7
  "sha": "ada4b7eb5bb7e013429e23703c271c0f34b0d76327c059efa148ea2794f96178"
8
8
  }
@@ -3,6 +3,6 @@
3
3
  "version": "1.0.0",
4
4
  "provider": "FJRG2007/enigma",
5
5
  "description": "Application and AI-agent security: secrets, authn/authz (least privilege), OWASP Top 10, transport/crypto baseline, secure logging, and agent/MCP/tool-use safety.",
6
- "cliVersion": "1.6.6",
6
+ "cliVersion": "1.6.7",
7
7
  "sha": "9971e9d9127397d0152e89d24aad3191e2935e55a8483db7fd15f5d4d7a60e7a"
8
8
  }
@@ -3,6 +3,6 @@
3
3
  "version": "1.0.0",
4
4
  "provider": "FJRG2007/enigma",
5
5
  "description": "Test strategy, coverage gates, deterministic tests, mocking discipline, and regression-first bug fixing.",
6
- "cliVersion": "1.6.6",
6
+ "cliVersion": "1.6.7",
7
7
  "sha": "d19fa8ec7985ed231478be504d3c80360897f555d0bc0624bea19c091f459fb0"
8
8
  }
@@ -3,6 +3,6 @@
3
3
  "version": "1.0.0",
4
4
  "provider": "FJRG2007/enigma",
5
5
  "description": "Strict frontend + backend schema validation, schema consistency, and safe client-facing error handling.",
6
- "cliVersion": "1.6.6",
6
+ "cliVersion": "1.6.7",
7
7
  "sha": "a33622a2f810ee4cea39824cb1a7ca34b355a917d4224025df50d77dd74f0b3a"
8
8
  }
@@ -1,6 +1,6 @@
1
1
  {
2
- "enigma-darwin-arm64": "a79c8a4da8dd28106ba7536ad67917e50a5bcdecfc5afea1a9e9f4075568aab8",
3
- "enigma-linux-arm64": "170e57ac5f6367a30b3ba55b5a831aadc0c2dcd22be03626c3cefd1f3f7c374d",
4
- "enigma-linux-x64": "bf1326b5544235358503d9519f9ef55383b5e75e95dd6da9b683e0c5a7ec7855",
5
- "enigma-win32-x64.exe": "42896ebe0d8f7b8088c8f201e57af48a140aec1bb15064e4c564fb205a0b3105"
2
+ "enigma-darwin-arm64": "6eac8ab4fa881993c1dd49fcc48b97f39b6a179e8b3b5e7e90f6e935e22d36dd",
3
+ "enigma-linux-arm64": "0ceac881b3b56211d63818cadffc60331bfd8d04272add877724087d70da6e0e",
4
+ "enigma-linux-x64": "ba09d59abbde314cadf01b66b664cf5d0cbf5663034b7ddd029372d84f45af7a",
5
+ "enigma-win32-x64.exe": "a8f97f35a708e34d5eaad2208ae201983b94babff9d10a7589e1ed2636dca12a"
6
6
  }
package/bin/enigma.mjs CHANGED
@@ -16,12 +16,40 @@
16
16
  */
17
17
 
18
18
  import { spawn } from "node:child_process";
19
- import { existsSync } from "node:fs";
19
+ import { existsSync, readFileSync } from "node:fs";
20
20
  import { join } from "node:path";
21
21
  import os from "node:os";
22
22
  import { ARCH, PLATFORM, packageVersion, pkgRoot } from "./platform.mjs";
23
23
  import { downloadBinary, installedBinary } from "./download.mjs";
24
24
 
25
+ /**
26
+ * Fast path: an agent status bar (e.g. Claude Code's statusLine) calls `enigma
27
+ * statusline` on every refresh. Handle it here in the lightweight Node launcher -
28
+ * reading .enigma.json directly - so it never resolves or spawns the Bun binary.
29
+ * Prints `[ENIGMA]` (cyan) while token-efficient output is active, nothing when off.
30
+ */
31
+ function readOutputStyle() {
32
+ let style = "off";
33
+ // Mirror config.ts precedence: global (~/.enigma.json) then local (cwd), nearest wins.
34
+ for (const dir of [os.homedir(), process.cwd()]) {
35
+ try {
36
+ const raw = JSON.parse(readFileSync(join(dir, ".enigma.json"), "utf8"));
37
+ if (raw && typeof raw.outputStyle === "string") style = raw.outputStyle;
38
+ } catch { /* missing/invalid .enigma.json - ignore */ }
39
+ }
40
+ return style;
41
+ }
42
+ if (process.argv[2] === "statusline") {
43
+ try {
44
+ const style = readOutputStyle();
45
+ if (style && style !== "off") {
46
+ const label = style === "full" ? "ENIGMA" : `ENIGMA:${style.toUpperCase()}`;
47
+ process.stdout.write(process.env.NO_COLOR ? `[${label}]` : `\x1b[36m[${label}]\x1b[0m`);
48
+ }
49
+ } catch { /* a status bar must never error */ }
50
+ process.exit(0);
51
+ }
52
+
25
53
  /** Resolve the binary, downloading it on first run if the postinstall was skipped. */
26
54
  async function resolveBinary() {
27
55
  if (process.env.ENIGMA_BIN_PATH && existsSync(process.env.ENIGMA_BIN_PATH)) return process.env.ENIGMA_BIN_PATH;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "enigma-cli",
3
- "version": "1.6.6",
3
+ "version": "1.6.7",
4
4
  "description": "Everything you need to work with a coding agent: install shared policy skills for Claude Code, OpenAI Codex and opencode, and set up portable git security hooks.",
5
5
  "type": "module",
6
6
  "bin": {