@curdx/flow 2.0.0-beta.12 → 2.0.0-beta.13

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.
@@ -6,7 +6,7 @@
6
6
  },
7
7
  "metadata": {
8
8
  "description": "Claude Code Discipline Layer — spec-driven workflow + goal-backward verification + Karpathy 4 principles enforced via gates. Stops Claude from faking \"done\" on non-trivial features.",
9
- "version": "2.0.0-beta.12"
9
+ "version": "2.0.0-beta.13"
10
10
  },
11
11
  "plugins": [
12
12
  {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "curdx-flow",
3
- "version": "2.0.0-beta.12",
3
+ "version": "2.0.0-beta.13",
4
4
  "description": "Claude Code Discipline Layer — spec-driven workflow + goal-backward verification + Karpathy 4 principles enforced via gates. Stops Claude from faking \"done\" on non-trivial features.",
5
5
  "author": {
6
6
  "name": "wdx",
package/bin/curdx-flow.js CHANGED
@@ -20,7 +20,8 @@
20
20
  * for the full command/workflow reference)
21
21
  */
22
22
 
23
- import { pathToFileURL } from "node:url";
23
+ import { fileURLToPath } from "node:url";
24
+ import { realpathSync } from "node:fs";
24
25
 
25
26
  import { install } from "../cli/install.js";
26
27
  import { doctor } from "../cli/doctor.js";
@@ -131,13 +132,29 @@ async function main() {
131
132
  }
132
133
 
133
134
  // Only execute main() when invoked directly (`node bin/curdx-flow.js ...`
134
- // or via the npm bin shim). When the file is imported by tests or tooling,
135
- // we want the module graph to load without side-effects. This idiom is
136
- // the ESM equivalent of Python's `if __name__ == "__main__"`.
137
- const invokedDirectly =
138
- process.argv[1] &&
139
- import.meta.url === pathToFileURL(process.argv[1]).href;
140
-
141
- if (invokedDirectly) {
135
+ // or via the npm bin shim at node_modules/.bin/<name>). When the file is
136
+ // imported by tests or tooling, we want the module graph to load without
137
+ // side-effects.
138
+ //
139
+ // CRITICAL: compare RESOLVED real paths. npm installs the bin as a symlink
140
+ // (node_modules/.bin/curdx-flow → ../@curdx/flow/bin/curdx-flow.js), so
141
+ // process.argv[1] is the symlink path while import.meta.url resolves to
142
+ // the real file. Comparing them directly (the pre-beta.13 behavior)
143
+ // silently skipped main() for every single npx / global-install user,
144
+ // producing a completely broken CLI that exited with no output. Regression
145
+ // caught by user report + reproduced in CI via test/cli-entrypoints.test.js.
146
+ function isInvokedDirectly() {
147
+ if (!process.argv[1]) return false;
148
+ try {
149
+ return realpathSync(process.argv[1]) === fileURLToPath(import.meta.url);
150
+ } catch {
151
+ // argv[1] is not a real filesystem path (e.g. `node -e` eval forms or
152
+ // a worker pipe). Treat as "not invoked directly" — the caller is
153
+ // doing something non-standard.
154
+ return false;
155
+ }
156
+ }
157
+
158
+ if (isInvokedDirectly()) {
142
159
  main();
143
160
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curdx/flow",
3
- "version": "2.0.0-beta.12",
3
+ "version": "2.0.0-beta.13",
4
4
  "description": "CLI installer for CurDX-Flow — AI engineering workflow meta-framework for Claude Code",
5
5
  "type": "module",
6
6
  "bin": {