Commit Graph

1 Commits

Author SHA1 Message Date
rUv 0bb7c4e3d7 fix: community bug batch — Windows path validation (#2352), trajectory-end feedback (#2351), init hooks settings (#2350) (#2355)
Three reproducible bugs reported by @grym3s, batched in the style of #2346.

#2352 — hooks post-edit: Windows paths rejected, failure printed as [OK]
  - validatePath used the general SHELL_META set which includes `\`, so
    every absolute Windows path (E:\Repos\...) failed with "shell
    metacharacters". Claude Code hook events deliver absolute paths in
    tool_input.file_path, so all Windows users had silent learning loss.
    Path-specific PATH_SHELL_META drops `\` (still rejects ; & | ` $ etc.)
    and the sanitized output normalizes to forward slashes.
  - CLI post-edit action printed `Outcome recorded for ...` whenever the
    MCP call returned at all, ignoring `{success:false}`. Now checks
    result.success, surfaces the error, and exits non-zero.

#2351 — trajectory-end: step-less feedback never distilled
  - When `trajectory-end` is called with `feedback` but no recorded steps,
    the feedback was persisted with the trajectory but never embedded as a
    searchable pattern — patternsExtracted always reported 0 and
    pattern-search never surfaced it. Step-less trajectories are the
    common case for LLM agents. Now routes feedback through the same
    bridge.bridgeStorePattern / store-fallback path that pattern-store
    uses, with modest default confidence (0.6 success / 0.4 failure)
    since step-less feedback hasn't been validated by execution evidence.
    Best-effort: distillation failures do not fail the trajectory-end call.

#2350 — init hooks: subcommand writes no hooks block
  - settings-generator (#1744 fix) only emits the `hooks` block when
    `components.helpers` is true, because hooks point at the helper
    handler script. The `init hooks` subcommand was setting helpers:false,
    so the one subcommand whose purpose is "Initialize only hooks
    configuration" produced settings.json with no `hooks` key while
    reporting "N hooks enabled". Helpers must ship with hooks.

Tests
- v3/@claude-flow/cli/__tests__/validate-input-path-2352.test.ts (22 tests):
  pins Windows-path acceptance, POSIX-path acceptance, and rejection of
  shell metacharacters, traversal, empty/non-string/oversized input.
- All existing validate-input, init-wizard-bugs, hooks-intelligence, and
  hooks-post-task tests still pass.
2026-06-11 10:59:04 -04:00