mirror of
https://github.com/instructkr/claw-code.git
synced 2026-04-28 03:24:59 +08:00
roadmap: #283 filed
This commit is contained in:
10
ROADMAP.md
10
ROADMAP.md
@@ -17193,3 +17193,13 @@ Distinct from #149 (working-directory permission policy), #178 (allow-broad-cwd)
|
||||
Required fix shape: (a) extend the global argument parser at `:824-1264` (where `allow_broad_cwd`, `--output-format`, `--date` and friends are wired) to recognize a top-level `--cwd <path>` flag that is canonicalized once and threaded into every command variant (`Run`, `Query`, `Doctor`, `RenderDiff`, `RunPrompt`, `RunPromptJson`, etc.) via a single `cwd: Option<PathBuf>` field on the dispatch struct; (b) replace the 25+ raw `env::current_dir()` calls inside the runtime crate with a `resolve_cwd(global_cwd_override)` helper that prefers the explicit override and falls back to `env::current_dir()` only when none was supplied; (c) audit `bash.rs`, `file_ops.rs`, `git_context.rs`, `hooks.rs`, `branch_lock.rs`, and `compact.rs` so each receives the resolved cwd as a parameter rather than re-querying `env::current_dir()` on its own; (d) reuse `enforce_broad_cwd_policy` against the explicit override so #178's policy gate triggers on caller-supplied paths; (e) add an integration test running `claw -p "pwd via bash tool" --cwd /tmp/scratch` from a different process cwd and asserting the bash tool's `pwd` output is `/tmp/scratch`, not the launcher's directory; (f) document `--cwd` in `--help`, `claw doctor --output-format json`'s capability block, and PARITY.md's supported-flags table so the upstream gap is no longer silent. Acceptance: a long-lived claw process or per-task dispatcher can point each `claw -p` invocation at a distinct working directory by flag without spawning a new OS process or mutating the parent process's cwd.
|
||||
|
||||
**Status:** Open. No source code changed. Filed 2026-04-26 17:38 KST. Branch: feat/jobdori-168c-emission-routing. HEAD: `db27ac2` before filing (post fast-forward onto gaebal-gajae's #281 dogfood-filing-transactionality pinpoint). Cluster delta: founds NEW `cwd-flag-runtime-dispatch-gap` cluster (1 member, #282 solo founder); cross-cluster with silent-fallback family (claw-code silently inherits parent process cwd instead of erroring on missing `--cwd`), with PARITY.md half-implementation pattern, and with #178/#149 cwd-policy-gate axis (upstream of policy enforcement). Concrete delta this cycle: ROADMAP-only pinpoint appended after static audit confirmed exactly two `"--cwd"` literal occurrences (one in `parse_system_prompt_args`, one in a test fixture), zero on the primary runtime dispatch path. Concurrent-dogfood-rebase parity will be confirmed local==origin==fork at HEAD `db27ac2+#282` after push.
|
||||
|
||||
## Pinpoint #283 — `auto_compaction_input_tokens_threshold` is only settable via environment variable `CLAUDE_CODE_AUTO_COMPACT_INPUT_TOKENS`; no config-file key and no CLI flag expose it, so the 100 000-token default is a silent constant from an operator's perspective
|
||||
|
||||
Static audit of `rust/crates/runtime/src/conversation.rs`. `new_with_features` (`:166-189`) calls `auto_compaction_threshold_from_env()` unconditionally at construction time; the builder method `with_auto_compaction_input_tokens_threshold` (`:198-201`) exists but is never called in the CLI dispatch path — `grep -n "with_auto_compaction_input_tokens_threshold" rust/crates/rusty-claude-cli/src/main.rs` returns zero results. `auto_compaction_threshold_from_env` reads `CLAUDE_CODE_AUTO_COMPACT_INPUT_TOKENS` from the process environment (`:690-697`); if absent or unparseable it falls back to `DEFAULT_AUTO_COMPACTION_INPUT_TOKENS_THRESHOLD = 100_000` (`:18, :703`). `RuntimeFeatureConfig` (`:56-68` of `config.rs`) has no `compaction_threshold` field; the config loader at `:300-340` of `config.rs` never attempts to populate one. `build_runtime_with_plugin_state` (`:7680-7740` of `main.rs`) builds `ConversationRuntime::new_with_features` from `feature_config` and never calls the builder method afterward.
|
||||
|
||||
Gap. An operator who wants to raise or lower the compaction threshold for a project (e.g., a repo with a large context that should compact at 200 000 tokens, or a tight CI harness that should compact at 50 000 tokens) has three choices: (a) set the env var before every invocation — fragile across wrappers that launch new processes without inheriting the callers env; (b) live with 100 000 — may be wrong for model or context size; (c) compile a custom binary. No `settings.json` key, no `.clawconfig` field, no `--compaction-threshold` CLI flag. The builder method proves the design allows per-runtime override but the CLI path never routes any input to it. Distinct from #282 (`--cwd` gap): #282 is about filesystem context; #283 is about conversation compaction policy. Distinct from #109/ConfigValidator: no validation failure occurs — the default simply fires silently.
|
||||
|
||||
Required fix shape: (a) add `auto_compaction_threshold: Option<u32>` to `RuntimeFeatureConfig` (`:56` of `config.rs`); (b) populate it from a `settings.json`/`.clawrc` key (e.g., `autoCompactionInputTokensThreshold`) in the config loader alongside existing feature flags; (c) add a top-level `--compaction-threshold <N>` CLI flag in the global arg parser, parsed into `CliArgs`; (d) in `build_runtime_with_plugin_state`, call `.with_auto_compaction_input_tokens_threshold(...)` with precedence: CLI flag > config file > env var > compiled default; (e) surface the resolved threshold in `claw doctor --output-format json` under a `compaction` block so operators can inspect which source won; (f) validate in `ConfigValidator` that the threshold is a positive integer and warn on values under 10 000 (probable misconfiguration). Acceptance: `claw -p "x" --compaction-threshold 200000` uses 200 000; a `settings.json` with `"autoCompactionInputTokensThreshold": 150000` uses 150 000; env var still overrides config but not CLI; `claw doctor` shows `compaction.threshold_source` as one of `cli`, `config`, `env`, `default`.
|
||||
|
||||
**Status:** Open. No source code changed. Filed 2026-04-26 18:00 KST. Branch: feat/jobdori-168c-emission-routing. HEAD: `b05561c` (post-rebase onto origin/main, #282 already present). Cluster delta: extends `silent-fallback-family` (threshold is silently inherited from env-only path, config/CLI lanes absent); builder method `with_auto_compaction_input_tokens_threshold` present but unreachable from CLI path. Concrete delta this cycle: ROADMAP-only pinpoint appended after static audit confirmed zero calls to `with_auto_compaction_input_tokens_threshold` in `main.rs`, no compaction field in `RuntimeFeatureConfig`, and env-var as the sole runtime override. Concurrent-dogfood-rebase parity will be confirmed local==origin==fork after push.
|
||||
|
||||
Reference in New Issue
Block a user