You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .archgate/adrs/ARCH-012-command-error-boundaries.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,8 @@ Async command actions that lack try-catch error boundaries produce poor user exp
18
18
19
19
This was discovered during a repository-wide review where `review-context`, `session-context claude-code`, and `session-context cursor` all lacked error boundaries.
20
20
21
+
The failure mode is also documented by incident CLI-5: `src/commands/check.ts` once wrapped only `loadRuleAdrs()` in try-catch, so a `UserError` thrown later by `runChecks()` escaped to `main().catch()`, where it was miscaptured to Sentry and exited with code 2 instead of 1. A boundary that covers only part of the action body fails exactly like no boundary at all — the try-catch MUST span the entire action.
22
+
21
23
ARCH-002 defines the exit code convention and logging patterns, but does not require error boundaries in command actions. This ADR complements ARCH-002 by making error boundaries mandatory.
22
24
23
25
**Why not a global Commander.js error handler?** Commander provides `.exitOverride()` and `.configureOutput()` for parsing errors (unknown options, missing arguments), but these do **not** cover errors thrown inside async `.action()` callbacks. Commander's `preAction`/`postAction` hooks could theoretically wrap actions, but they don't catch async errors from the action body. The `main().catch()` in `cli.ts` catches unhandled rejections as a safety net (exit 2), but per-command try-catch is needed to produce contextual error messages and exit with code 1 instead of 2.
Copy file name to clipboardExpand all lines: .archgate/adrs/ARCH-015-cli-command-documentation-coverage.rules.ts
+4-8Lines changed: 4 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -16,13 +16,10 @@ export default {
16
16
"Every top-level CLI command (src/commands/<name>.ts or src/commands/<name>/index.ts) must have a corresponding reference page at docs/src/content/docs/reference/cli/<name>.mdx, and vice versa",
17
17
severity: "error",
18
18
asynccheck(ctx){
19
-
// Discover top-level command names from src/commands/.
20
-
// Per ARCH-001, top-level commands live at either
21
-
// src/commands/<name>.ts — single-file command
22
-
// src/commands/<name>/index.ts — command group
23
-
// Nested files like src/commands/<name>/create.ts or
24
-
// src/commands/<name>/<sub>/index.ts are subcommands and NOT
25
-
// independent top-level commands.
19
+
// Discover top-level command names from src/commands/. Per ARCH-001
20
+
// they live at src/commands/<name>.ts (single-file) or
21
+
// src/commands/<name>/index.ts (command group); nested files are
22
+
// subcommands, not independent top-level commands.
Copy file name to clipboardExpand all lines: .archgate/adrs/ARCH-019-inquirer-prompt-fix.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,3 +74,4 @@ Code reviewers MUST verify any new interactive flow wraps its prompts in `withPr
74
74
75
75
-[ARCH-018: Lazy-Load Heavy Dependencies](./ARCH-018-lazy-load-heavy-dependencies.md) — `inquirer` is loaded lazily; this ADR governs how its prompts are invoked
76
76
-[`src/helpers/prompt.ts`](../../src/helpers/prompt.ts) — defines `withPromptFix()` and the stdout patch
77
+
-[Inquirer.js issue #2123](https://github.com/SBoudrias/Inquirer.js/issues/2123) — upstream report of the unrestored Windows console-mode flag
0 commit comments