Skip to content

feat(init): make the generated cocosearch.yaml a complete config reference - #84

Merged
VioletCranberry merged 4 commits into
mainfrom
feat/init-controller-config
Jun 2, 2026
Merged

feat(init): make the generated cocosearch.yaml a complete config reference#84
VioletCranberry merged 4 commits into
mainfrom
feat/init-controller-config

Conversation

@VioletCranberry

Copy link
Copy Markdown
Owner

Summary

cocosearch init generated a config that documented only indexing, search, and embedding (model only). Several supported config sections were missing, so they were effectively
undiscoverable to anyone who didn't read the README:

  • the optional query-rewrite controller
  • embedding providers (provider / baseUrl for ollama/openai/openrouter)
  • file logging (logging.file)

This PR fills those gaps so the generated cocosearch.yaml doubles as a full, accurate config reference — and brings it in line with the README and the Pydantic schema.

What changed

CONFIG_TEMPLATE (generator.py) — added commented-out blocks for:

  • embedding: provider, per-provider model defaults, baseUrl (custom/OpenAI-compatible endpoints), outputDimension, plus COCOSEARCH_EMBEDDING_API_KEY / --fresh reindex notes
  • controller: enabled / provider / model / baseUrl / timeout
  • logging: the file toggle → ~/.cocosearch/logs/

Everything is commented out, so the generated config is byte-for-byte inert — no behavior change, no generative model ever called by default. The style matches the existing linkedIndexes
example.

Docs:

  • docs/cli-reference.md — the init section listed only 5 of the 7 interactive prompts/flags. Added the missing --no-claude-settings and --no-claude-hook (pre-existing debt from the merged
    nudge-hook work), plus a note that the generated config documents every section.
  • README.md — added a logging: block to the hand-written cocosearch.yaml example so it mirrors the complete template.

Why commented-out

The template's convention is "documented but inert" — every field is a commented example (see linkedIndexes). A user opts in by uncommenting. This keeps init as the single source of truth
for what's configurable without changing any defaults.

Testing

  • uv run pytest tests/unit/config/ tests/unit/test_cli_init.py — 295 passed
  • uv run ruff check / ruff format — clean
  • New tests:
    • presence checks for the controller, embedding-provider, and logging docs
    • two schema-validation guards that uncomment the controller and logging examples and load them through ControllerSection / LoggingSection, so the documented examples can't silently
      drift from the schema (shared, block-bounded _uncomment_block helper)
  • Manual smoke: real init renders all sections and the result loads as a valid config (embedding.provider=ollama, controller.enabled=False, logging.file=False)

VioletCranberry and others added 4 commits June 2, 2026 11:20
…nfig

`cocosearch init` generated a cocosearch.yaml that documented indexing,
search, and embedding — but never mentioned the optional query-rewrite
controller, so it was undiscoverable to anyone who didn't read the README.

Add a commented-out `controller:` block to CONFIG_TEMPLATE matching the
template's documented-but-inert style (like linkedIndexes). It stays fully
commented, so generated behavior is byte-for-byte unchanged and no
generative model is ever called by default. This brings the init template
in line with the controller example already in README.md.

- generator.py: commented controller block (enabled/provider/model, with
  baseUrl/timeout as nested optional comments) and a short explanation
- tests: assert the comment is present, plus a schema-validation guard
  that uncomments the example and loads it through ControllerSection so
  the docs can't drift out of sync with the schema

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…late

Round out the init-generated cocosearch.yaml so it documents every config
section the schema supports. Building on the controller block, add:

- embedding: provider (ollama/openai/openrouter), per-provider model
  defaults, baseUrl for custom/OpenAI-compatible endpoints, outputDimension,
  and the COCOSEARCH_EMBEDDING_API_KEY / --fresh reindex notes
- logging: the file toggle (default off) writing to ~/.cocosearch/logs/

All additions are commented out, so generated behavior is unchanged. This
brings the template fully in line with README.md and the schema.

Tests: presence checks for the embedding-provider and logging docs, plus a
LoggingSection schema-validation guard mirroring the controller one. The
uncomment-and-validate helper is now shared and bounded to each block.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…config

The init section listed only 5 of the 7 interactive prompts and flags —
missing --no-claude-settings (Claude Code permissions) and --no-claude-hook
(the search_code nudge hook). Add both to the numbered prompt list, the flag
table, and the non-interactive example. Also note that the generated
cocosearch.yaml documents every section (indexing, search, embedding
providers, controller, logging) as commented examples.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The hand-written config example showed embedding and controller but not the
file-logging toggle. Add a logging block so the README example mirrors the
now-complete init template.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@VioletCranberry
VioletCranberry merged commit e4570e2 into main Jun 2, 2026
5 checks passed
@VioletCranberry
VioletCranberry deleted the feat/init-controller-config branch June 2, 2026 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant