Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 21, 17:15 UTC
docs(cli): state installer design constraints inline instead of KD tags
Ten comments across install.sh, install.cmd.ts, and the harness cited KD2/KD3/KD4/KD7 decisions from a plan file that exists on no branch. Rewrite each comment to carry its constraint inline — the truthful final action block, delegation trust via physical path comparison, non-fatal setup failures, and copy-paste-safe endings — and drop the dangling references.
jkomyno committed
Aug 3, 2026 at 21:12 UTC
2655e30c70b015cce59c63be5f6a308f68704240
3 files changed
+21
-15
install.sh
+7
-4
@@ -322,7 +322,9 @@ shell_quote() {
322
}
323
324
# Follows symlinks and resolves the parent directory physically, so two paths
325
-# compare equal exactly when they name the same executable (KD3).
325
+# compare equal exactly when they name the same executable: the final block's
326
+# installed-vs-shadowed verdict must not change just because one side reaches
327
+# the binary through a symlink alias.
328
resolve_physical_path() {
329
resolve_physical_target=$1
330
resolve_physical_steps=0
@@ -605,9 +607,10 @@ setup_requested_shell() {
607
return 1
608
}
609
608
-# Final action block for every non-failure flow (KD4 state matrix). KD7: this
609
-# is the last output; nothing prints after it. Suppressible because it only
610
-# covers normal success.
610
+# Final action block for every non-failure flow: one truthful ending chosen
611
+# from the inherited-resolution and setup-outcome state. It must be the last
612
+# output — the closing block is the instruction users copy, so nothing may
613
+# print after it. Suppressible because it only covers normal success.
614
print_post_install_help() {
615
[ "${COMPOSIO_INSTALL_HELP:-1}" != 0 ] || return 0
616
if is_true "${COMPOSIO_QUIET:-}"; then
test/install-sh-release-resolution.test.sh
+9
-7
@@ -30,7 +30,8 @@ assert_not_contains() {
30
}
31
32
# Asserts the exact final N lines of an output capture, proving nothing prints
33
-# after the final action block (KD7: the last block wins).
33
+# after the final action block: the ending is the instruction users copy, so
34
+# the last block must win.
35
assert_tail() {
36
local haystack=$1
37
local expected=$2
@@ -156,7 +157,8 @@ github_url='https://github.example.test'
157
archive_url="https://downloads.example.test/$stable_tag/$archive_name"
158
script_url='https://installer.example.test/install.sh'
159
159
-# KD4 exact endings: plain indented lines, no box drawing, nothing after them.
160
+# Exact endings the installer must close with: plain indented lines, no box
161
+# drawing, nothing after them, so the final instruction stays copy-paste safe.
162
case_a_tail=$'composio is ready.\n\n composio login'
163
case_b_tail=$'Open a new terminal, then run:\n\n composio login'
164
@@ -815,7 +817,7 @@ EOF
817
[[ ! -e "$base_failure_home/.zshrc" ]] || fail "$interpreter_name $base_mode download must not write rc"
818
done
819
818
- # --- Auto shell setup default (KD2/KD3) ---
820
+ # --- Auto shell setup default: $SHELL picks the shell, setup delegates to the CLI ---
821
822
# Every recognized default-flow shell delegates through the setup chain.
823
for auto_shell in zsh bash fish; do
@@ -1001,7 +1003,7 @@ EOF
1003
assert_contains "$bash_login_only_output" 'Configured bash shell setup in ~/.bashrc and ~/.bash_login.' "$interpreter_name .bash_login disclosure"
1004
assert_login_bash_path "$bash_login_only_home" "$bash_login_only_bin" "$interpreter_name .bash_login login shell"
1005
1004
- # --- Setup write failures stay non-fatal (KD3/KD4) ---
1006
+ # --- Setup write failures stay non-fatal: the binary stays installed and the ending stays truthful ---
1007
1008
# Delegated path: CLI --shell fails, inline fallback also fails.
1009
reset_case
@@ -1029,7 +1031,7 @@ EOF
1031
assert_contains "$wf_inline_output" 'warning: Automatic PATH setup for bash failed' "$interpreter_name inline setup failure warning"
1032
assert_tail "$wf_inline_output" $'To get started, run:\n\n '"$wf_inline_install/composio login" "$interpreter_name inline setup failure recovery tail"
1033
1032
- # --- Managed-block reconciliation (KD3) ---
1034
+ # --- Managed-block reconciliation: a rerun replaces stale blocks instead of stacking duplicates ---
1035
1036
reset_case
1037
CASE_SHELL_CAPABILITY=unsupported
@@ -1145,7 +1147,7 @@ export PATH=\"$malformed_bin:\$PATH\"" ]] || fail "$interpreter_name malformed b
1147
grep -Fq 'alias stale-guard=1' "$stale_home/.zshrc" || fail "$interpreter_name stale reconcile preserves unmanaged content"
1148
assert_tail "$stale_output" "$case_b_tail" "$interpreter_name stale delegation Case B tail"
1149
1148
- # --- Unsafe resolved bin dirs under the default flow (KD3) ---
1150
+ # --- Unsafe resolved bin dirs under the default flow: shell metacharacters never reach rc files ---
1151
1152
unsafe_auto_index=0
1153
for unsafe_character in ';' '$'; do
@@ -1183,7 +1185,7 @@ export PATH=\"$malformed_bin:\$PATH\"" ]] || fail "$interpreter_name malformed b
1185
fail "$interpreter_name spaced recovery command must execute when pasted"
1186
[[ $space_paste_output == 'composio fake 98.0.0' ]] || fail "$interpreter_name spaced recovery command output"
1187
1186
- # --- Final-block contract combinations (KD4/KD7) ---
1188
+ # --- Final-block contract combinations: exactly one truthful ending, always last ---
1189
1190
# Plugin output completes before the final block.
1191
reset_case
ts/packages/cli/src/commands/install.cmd.ts
+5
-4
@@ -631,10 +631,11 @@ export const installShellIntegration = (params: {
631
return yield* new ShellSetupAbortError({ message });
632
}
633
634
- // KD7 (final-block contract): when install.sh delegates to this command it
635
- // passes COMPOSIO_CLI_INVOCATION_ORIGIN=installer and owns the final action
636
- // block itself. Keep the concise per-file status lines but suppress the
637
- // boxed restart hint so the CLI never prints a competing instruction.
634
+ // The installer owns the closing message: when install.sh delegates to
635
+ // this command it passes COMPOSIO_CLI_INVOCATION_ORIGIN=installer and
636
+ // prints the final action block itself. Keep the concise per-file status
637
+ // lines but suppress the boxed restart hint so the CLI never prints a
638
+ // competing instruction.
639
const invocationOrigin = yield* readOptionalEnv('COMPOSIO_CLI_INVOCATION_ORIGIN');
640
const installerOwnsFinalMessaging = invocationOrigin === 'installer';
641