Arguments, settings and documented facts disagree or lack one checked source #570

Open
opened 2026-11-11 09:20:48 +01:00 by buildagent · 5 comments
Member

Scope (consolidated 2026-11-12)

Clients encounter uneven filters, names and limits across tools. Operators also need settings, environment variables and CLI flags to share validation, defaults and precedence. Documentation must describe the shipped behavior and derive facts that otherwise drift. One registry should generate or check these contracts and expose the effective values and their sources.

Priority: Medium · Risk: cost · Size: L
Merged into this ticket: #527 (Documentation truth and structure)

Done

  • policy, validation and applied-range projection in crates/mcp-server/src/arguments.rs drive schemas/errors; docs/mcp-arguments.md is checked in both directions, and list/dependency/gap tools accept concise output.
  • All string arguments are limited to 8,192 characters with invalid_argument_value on master; every_published_string_argument_has_a_safe_boundary and text_query_length_refusal_is_bounded_before_dispatch in crates/mcp-server/tests/argument_reference_e2e.rs grade it. Release verification stays in #575.
  • docs/configuration.md inventories accepted keys/environment variables; configuration_reference_matches_decoder_both_ways in crates/indexer/tests/configuration_reference.rs checks key-table/decoder agreement.
  • The v0.41.51 tree corrects 32 false README/CONTRIBUTING/docs statements, including package/source-build/authoring guidance; the config reference marks no-effect keys rather than promising they work.

Remaining

Argument families and names

  • Complete eleven planned lang/path_glob filter cells, additive aliases and diff limits; distinguish output verbosity from encoding and retain family exemptions explicitly. (#570)

Settings registry and disclosure

  • Register Config/env/CLI keys, defaults, enums, bounds, precedence and docs; share typed duration zero/range/overflow rules and requested/applied/source disclosure, with effective-settings inspection. (#570)

Compatibility and release settings

  • Decide the fate of six warned no-effect keys: watcher.mode, watcher.poll_interval_ms, logging.level, logging.format, workspace.name and plugins[].file. (#570, #527)
  • Guard or document the six release-read test cadence hooks: CODE_INDEX_RECONCILE_INTERVAL_MS, CODE_INDEX_WAL_CHECKPOINT_MS, CODE_INDEX_SCHEMA_CHECK_MS, CODE_INDEX_ACTIVATION_POLL_MS, CODE_INDEX_RECONCILE_DELAY_MS and CODE_INDEX_READ_SPAN_TOCTOU_DELAY_MS. (#570)
  • Resolve test-like COSI_CORPUS_DIR/COSI_WORKTREES_DIR names used for shipped project links and correct the watcher config comment/diagnostic that denies the existing polling fallback. (#570)

Documentation structure and facts

  • Write a short README with a docs index and an invariant-rather-than-history comment policy. (#527)
  • Remove or derive enumerated counts/facts, check retained facts in one registry and broaden citation scanning to docs/** and MCP-served docs. (#527)

Acceptance

  • One registry generates or checks schemas, help and references; fail if a tool argument, config key, CLI flag or environment variable lacks an entry. Family acceptance matrices cover filters and structured range/type errors.
  • Duration rules, defaults, precedence and requested/applied/source disclosure agree across daemon and foreground paths; effective settings can be inspected.
  • Remaining enumerated facts are removed or derived and checked, citation scans cover public/MCP docs, and a short README leads to an indexed docs set.

Decisions needed from the operator

  • “keep accepting them with a warning, or refuse them like an unknown key after a deprecation period” (six no-effect keys). — #570.
  • “They should either become stated settings or move behind the debug/test-seam guard” (six test cadence hooks). — #570.

Suggested order

  1. Finish argument-family cells, aliases and naming; host only, no language package release or bind account.
  2. Unify Config/env/CLI durations and effective settings, resolving compatibility/test-hook policies; host only, no bind change intended.
  3. Shorten/index docs and gate retained facts/citations; documentation only, no package release or bind account.

Original report

Follow-up to the configuration and argument audit of 2026-11-11 (operator principle: the system must be easy, consistent, fully documented and trustful for user, MCP client and agent). The audit's ten blockers are fixed in the v0.41.49 train. These six findings need one shared design, not six separate fixes.

S1 — Common arguments are accepted unevenly. list_files, get_dependencies and resolution_gaps reject response_format, which row-producing siblings accept. resolution_gaps cannot page its sample. list_files, the diff tools and repo_map lack lang. Graph, dependency, outline and map tools cannot narrow output by path_glob. Proposal: define capability families (row lists, graphs, single objects, budgeted output) and require each family's common arguments or a documented exemption.

S2 — One concept has several names. Examples: idle_timeout_min / idle-min; registry-url / catalog / source; CLI sha256 / expect-digest / digest against MCP digest; base against diff_base; id / symbol_id / target. response_format means detailed/concise everywhere except read_code, where it means json/text. Proposal: record the canonical concept and scope in the registry, add compatible aliases where the cost is high, and separate output encoding from verbosity.

S3 — Defaults, enums and bounds are not machine-readable everywhere. Page caps, batch caps, enum vocabularies and project defaults live in prose and handlers. The v0.41.49 train moved the numeric bounds it found into the schemas; the enums, maxItems and defaults are still open. Proposal: generate schema constraints, argument descriptions and the human reference from the same values.

S4 — The same duration setting is validated differently. The daemon requires 10–60000 ms for debounce and falls back with a warning; the foreground watcher accepts any value. Reconcile minutes multiply without saturation, idle minutes saturate. Proposal: shared typed duration parsers with one zero/range rule.

S5 — Applied values are disclosed unevenly. Some invalid environment values warn, several numeric ones silently use the default. search_text clamps context_tokens to 1–64 without echoing the applied width, while repo_map echoes its clamped budget. Proposal: one requested/applied/source disclosure, plus an effective-settings inspection command.

S6 — Numeric argument errors are unstructured. A negative limit passes the schema gate's coarse type check and ends as a free-text deserialization error, without the accepted range that a misspelt argument name gets. Proposal: extend the shared validator to declared bounds and translate deserialization failures into the structured invalid_arguments contract.

Also from review of the train: public reference documentation should live under docs/. The complete package-profile reference currently sits in _prdoc/guides/80-package-authoring.md and is linked from docs/operations.md.

Existing guards and what they do not cover: crates/daemon/tests/argument_registry_e2e.rs derives the optional RPC arguments and proves each changes the daemon's answer. It does not cover config keys, CLI flags, environment variables, MCP-only arguments, defaults, precedence or documentation.

Acceptance: one registry from which schema constraints, help text and the reference are generated or checked; a test that fails when an argument, key or variable exists without an entry; the acceptance matrix per tool family; structured errors for every out-of-range value.

## Scope (consolidated 2026-11-12) Clients encounter uneven filters, names and limits across tools. Operators also need settings, environment variables and CLI flags to share validation, defaults and precedence. Documentation must describe the shipped behavior and derive facts that otherwise drift. One registry should generate or check these contracts and expose the effective values and their sources. **Priority:** Medium · **Risk:** cost · **Size:** L **Merged into this ticket:** #527 (Documentation truth and structure) ## Done - `policy`, validation and applied-range projection in `crates/mcp-server/src/arguments.rs` drive schemas/errors; `docs/mcp-arguments.md` is checked in both directions, and list/dependency/gap tools accept concise output. - All string arguments are limited to 8,192 characters with invalid_argument_value on master; `every_published_string_argument_has_a_safe_boundary` and `text_query_length_refusal_is_bounded_before_dispatch` in `crates/mcp-server/tests/argument_reference_e2e.rs` grade it. Release verification stays in #575. - `docs/configuration.md` inventories accepted keys/environment variables; `configuration_reference_matches_decoder_both_ways` in `crates/indexer/tests/configuration_reference.rs` checks key-table/decoder agreement. - The v0.41.51 tree corrects 32 false README/CONTRIBUTING/docs statements, including package/source-build/authoring guidance; the config reference marks no-effect keys rather than promising they work. ## Remaining ### Argument families and names - Complete eleven planned lang/path_glob filter cells, additive aliases and diff limits; distinguish output verbosity from encoding and retain family exemptions explicitly. (#570) ### Settings registry and disclosure - Register Config/env/CLI keys, defaults, enums, bounds, precedence and docs; share typed duration zero/range/overflow rules and requested/applied/source disclosure, with effective-settings inspection. (#570) ### Compatibility and release settings - Decide the fate of six warned no-effect keys: watcher.mode, watcher.poll_interval_ms, logging.level, logging.format, workspace.name and plugins[].file. (#570, #527) - Guard or document the six release-read test cadence hooks: CODE_INDEX_RECONCILE_INTERVAL_MS, CODE_INDEX_WAL_CHECKPOINT_MS, CODE_INDEX_SCHEMA_CHECK_MS, CODE_INDEX_ACTIVATION_POLL_MS, CODE_INDEX_RECONCILE_DELAY_MS and CODE_INDEX_READ_SPAN_TOCTOU_DELAY_MS. (#570) - Resolve test-like COSI_CORPUS_DIR/COSI_WORKTREES_DIR names used for shipped project links and correct the watcher config comment/diagnostic that denies the existing polling fallback. (#570) ### Documentation structure and facts - Write a short README with a docs index and an invariant-rather-than-history comment policy. (#527) - Remove or derive enumerated counts/facts, check retained facts in one registry and broaden citation scanning to docs/** and MCP-served docs. (#527) ## Acceptance - One registry generates or checks schemas, help and references; fail if a tool argument, config key, CLI flag or environment variable lacks an entry. Family acceptance matrices cover filters and structured range/type errors. - Duration rules, defaults, precedence and requested/applied/source disclosure agree across daemon and foreground paths; effective settings can be inspected. - Remaining enumerated facts are removed or derived and checked, citation scans cover public/MCP docs, and a short README leads to an indexed docs set. ## Decisions needed from the operator - “keep accepting them with a warning, or refuse them like an unknown key after a deprecation period” (six no-effect keys). — #570. - “They should either become stated settings or move behind the debug/test-seam guard” (six test cadence hooks). — #570. ## Suggested order 1. Finish argument-family cells, aliases and naming; host only, no language package release or bind account. 2. Unify Config/env/CLI durations and effective settings, resolving compatibility/test-hook policies; host only, no bind change intended. 3. Shorten/index docs and gate retained facts/citations; documentation only, no package release or bind account. ## Original report Follow-up to the configuration and argument audit of 2026-11-11 (operator principle: the system must be easy, consistent, fully documented and trustful for user, MCP client and agent). The audit's ten blockers are fixed in the v0.41.49 train. These six findings need one shared design, not six separate fixes. **S1 — Common arguments are accepted unevenly.** `list_files`, `get_dependencies` and `resolution_gaps` reject `response_format`, which row-producing siblings accept. `resolution_gaps` cannot page its sample. `list_files`, the diff tools and `repo_map` lack `lang`. Graph, dependency, outline and map tools cannot narrow output by `path_glob`. Proposal: define capability families (row lists, graphs, single objects, budgeted output) and require each family's common arguments or a documented exemption. **S2 — One concept has several names.** Examples: `idle_timeout_min` / `idle-min`; `registry-url` / `catalog` / `source`; CLI `sha256` / `expect-digest` / `digest` against MCP `digest`; `base` against `diff_base`; `id` / `symbol_id` / `target`. `response_format` means detailed/concise everywhere except `read_code`, where it means json/text. Proposal: record the canonical concept and scope in the registry, add compatible aliases where the cost is high, and separate output encoding from verbosity. **S3 — Defaults, enums and bounds are not machine-readable everywhere.** Page caps, batch caps, enum vocabularies and project defaults live in prose and handlers. The v0.41.49 train moved the numeric bounds it found into the schemas; the enums, `maxItems` and defaults are still open. Proposal: generate schema constraints, argument descriptions and the human reference from the same values. **S4 — The same duration setting is validated differently.** The daemon requires 10–60000 ms for debounce and falls back with a warning; the foreground watcher accepts any value. Reconcile minutes multiply without saturation, idle minutes saturate. Proposal: shared typed duration parsers with one zero/range rule. **S5 — Applied values are disclosed unevenly.** Some invalid environment values warn, several numeric ones silently use the default. `search_text` clamps `context_tokens` to 1–64 without echoing the applied width, while `repo_map` echoes its clamped budget. Proposal: one requested/applied/source disclosure, plus an effective-settings inspection command. **S6 — Numeric argument errors are unstructured.** A negative `limit` passes the schema gate's coarse type check and ends as a free-text deserialization error, without the accepted range that a misspelt argument name gets. Proposal: extend the shared validator to declared bounds and translate deserialization failures into the structured `invalid_arguments` contract. **Also from review of the train:** public reference documentation should live under `docs/`. The complete package-profile reference currently sits in `_prdoc/guides/80-package-authoring.md` and is linked from `docs/operations.md`. **Existing guards and what they do not cover:** `crates/daemon/tests/argument_registry_e2e.rs` derives the optional RPC arguments and proves each changes the daemon's answer. It does not cover config keys, CLI flags, environment variables, MCP-only arguments, defaults, precedence or documentation. **Acceptance:** one registry from which schema constraints, help text and the reference are generated or checked; a test that fails when an argument, key or variable exists without an entry; the acceptance matrix per tool family; structured errors for every out-of-range value.
Author
Member

Released in v0.41.50 (first part).

  • One policy per argument drives the published schema, the runtime check and the error text. Reference: docs/mcp-arguments.md, compared with the schema in both directions by a test.
  • invalid_argument_value replaces ten older codes; the four malformed-argument codes share one field set (error, tool, query, received, accepted, default, hint). Every other error body is unchanged; nineteen are compared with bodies recorded from v0.41.49.
  • A clamped value is echoed in arguments_applied. response_format: "concise" is accepted by list_files, get_dependencies and resolution_gaps.
  • tools/list is smaller than in v0.41.49 (59,167 against 59,311 bytes).

Still open: path_glob and lang output filters on the reference, dependency and diff tools (eleven cells, listed as planned exemptions in the reference), additive aliases, limit on the diff tools, and the same registry for configuration keys, environment variables, CLI flags and durations. #575 (found in this train's CI) belongs to the same policy: search_text.query has no length bound, and a very long literal costs quadratic time in the FTS5 phrase parser.

Released in v0.41.50 (first part). - One policy per argument drives the published schema, the runtime check and the error text. Reference: `docs/mcp-arguments.md`, compared with the schema in both directions by a test. - `invalid_argument_value` replaces ten older codes; the four malformed-argument codes share one field set (`error`, `tool`, `query`, `received`, `accepted`, `default`, `hint`). Every other error body is unchanged; nineteen are compared with bodies recorded from v0.41.49. - A clamped value is echoed in `arguments_applied`. `response_format: "concise"` is accepted by `list_files`, `get_dependencies` and `resolution_gaps`. - `tools/list` is smaller than in v0.41.49 (59,167 against 59,311 bytes). Still open: `path_glob` and `lang` output filters on the reference, dependency and diff tools (eleven cells, listed as planned exemptions in the reference), additive aliases, `limit` on the diff tools, and the same registry for configuration keys, environment variables, CLI flags and durations. #575 (found in this train's CI) belongs to the same policy: `search_text.query` has no length bound, and a very long literal costs quadratic time in the FTS5 phrase parser.
Author
Member

Findings for the configuration half of this issue, from writing docs/configuration.md against the code (branch for the next release, not released yet). The reference lists every accepted .code-index.toml key and every environment variable the release binaries read; a test compares the key table with the decoder's field lists in both directions.

What the inventory showed:

  • Six accepted keys have no effect: watcher.mode, watcher.poll_interval_ms, logging.level, logging.format, workspace.name, plugins[].file. They are accepted, the diagnostics warn about them, and nothing else reads them. The reference marks each "no effect". Open question for the registry: keep accepting them with a warning, or refuse them like an unknown key after a deprecation period.
  • Six test cadence hooks are read by release binaries without a guard: CODE_INDEX_RECONCILE_INTERVAL_MS, CODE_INDEX_WAL_CHECKPOINT_MS, CODE_INDEX_SCHEMA_CHECK_MS, CODE_INDEX_ACTIVATION_POLL_MS, CODE_INDEX_RECONCILE_DELAY_MS, CODE_INDEX_READ_SPAN_TOCTOU_DELAY_MS. The last one is a fault-injection delay whose own comment says production never sets it. The reference lists them in a separate table as not recommended. They should either become stated settings or move behind the debug/test-seam guard other fault injection already uses.
  • COSI_CORPUS_DIR and COSI_WORKTREES_DIR are read by the shipped MCP server to expose linked projects; the names read as test switches.
  • A stale statement in the code: the [watcher] config comments and the diagnostic say no polling backend exists; the watcher engages a polling fallback automatically when native delivery is not observed. The reference describes the actual behaviour.
Findings for the configuration half of this issue, from writing `docs/configuration.md` against the code (branch for the next release, not released yet). The reference lists every accepted `.code-index.toml` key and every environment variable the release binaries read; a test compares the key table with the decoder's field lists in both directions. What the inventory showed: - **Six accepted keys have no effect:** `watcher.mode`, `watcher.poll_interval_ms`, `logging.level`, `logging.format`, `workspace.name`, `plugins[].file`. They are accepted, the diagnostics warn about them, and nothing else reads them. The reference marks each "no effect". Open question for the registry: keep accepting them with a warning, or refuse them like an unknown key after a deprecation period. - **Six test cadence hooks are read by release binaries without a guard:** `CODE_INDEX_RECONCILE_INTERVAL_MS`, `CODE_INDEX_WAL_CHECKPOINT_MS`, `CODE_INDEX_SCHEMA_CHECK_MS`, `CODE_INDEX_ACTIVATION_POLL_MS`, `CODE_INDEX_RECONCILE_DELAY_MS`, `CODE_INDEX_READ_SPAN_TOCTOU_DELAY_MS`. The last one is a fault-injection delay whose own comment says production never sets it. The reference lists them in a separate table as not recommended. They should either become stated settings or move behind the debug/test-seam guard other fault injection already uses. - **`COSI_CORPUS_DIR` and `COSI_WORKTREES_DIR` are read by the shipped MCP server** to expose linked projects; the names read as test switches. - **A stale statement in the code:** the `[watcher]` config comments and the diagnostic say no polling backend exists; the watcher engages a polling fallback automatically when native delivery is not observed. The reference describes the actual behaviour.
buildagent changed title from One registry for arguments, settings and their bounds: consistent acceptance, names, defaults and errors across CLI, config, env and MCP to Arguments, settings and documented facts disagree or lack one checked source 2026-11-12 22:22:54 +01:00
Author
Member

Status after v0.41.52: unchanged in this release. Still open and waiting for an operator decision: the six test timing hooks that release binaries still read, and the six configuration keys without effect that are still accepted with a warning.

Status after [v0.41.52](https://git.h-dv.de/h-dv/code-index/releases/tag/v0.41.52): unchanged in this release. Still open and waiting for an operator decision: the six test timing hooks that release binaries still read, and the six configuration keys without effect that are still accepted with a warning.
Author
Member

Operator decisions, 2026-11-13 (asked as two concrete questions, answered in the session):

  1. The six configuration keys without effect (watcher.mode, watcher.poll_interval_ms, logging.level, logging.format, workspace.name, plugins[].file): refuse after one release. The next release keeps accepting them and its warning says that the key has no effect and will be refused from the release after it. From that release on they are refused like any unknown key.
  2. The six test timing hooks read by release binaries (CODE_INDEX_RECONCILE_INTERVAL_MS, CODE_INDEX_WAL_CHECKPOINT_MS, CODE_INDEX_SCHEMA_CHECK_MS, CODE_INDEX_ACTIVATION_POLL_MS, CODE_INDEX_RECONCILE_DELAY_MS, CODE_INDEX_READ_SPAN_TOCTOU_DELAY_MS): debug builds only. Release binaries ignore them.

Both are being implemented in a lane now.

**Operator decisions, 2026-11-13** (asked as two concrete questions, answered in the session): 1. **The six configuration keys without effect** (`watcher.mode`, `watcher.poll_interval_ms`, `logging.level`, `logging.format`, `workspace.name`, `plugins[].file`): **refuse after one release.** The next release keeps accepting them and its warning says that the key has no effect and will be refused from the release after it. From that release on they are refused like any unknown key. 2. **The six test timing hooks read by release binaries** (`CODE_INDEX_RECONCILE_INTERVAL_MS`, `CODE_INDEX_WAL_CHECKPOINT_MS`, `CODE_INDEX_SCHEMA_CHECK_MS`, `CODE_INDEX_ACTIVATION_POLL_MS`, `CODE_INDEX_RECONCILE_DELAY_MS`, `CODE_INDEX_READ_SPAN_TOCTOU_DELAY_MS`): **debug builds only.** Release binaries ignore them. Both are being implemented in a lane now.
Author
Member

This release still accepts six configuration keys without effect, but warns that they will be refused from the next release on; remove them from .code-index.toml. Six test timing hooks remain readable by release binaries; making them debug-only is prepared for the next release.

This release still accepts six configuration keys without effect, but warns that they will be refused from the next release on; remove them from `.code-index.toml`. Six test timing hooks remain readable by release binaries; making them debug-only is prepared for the next release.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
h-dv/code-index#570
No description provided.