Repository navigation
Description
Summary
Add a /dewey-configure slash command that helps users configure .uf/dewey/sources.yaml — the content-source file that drives Dewey's disk, GitHub, web, and code indexing. Today, users hand-edit this YAML and frequently get the schema wrong (missing id/type/name, invalid trust_tier, wrong per-type config keys), which surfaces later as confusing dewey status/dewey doctor failures.
The command is an interactive wizard that discovers what the user could index, asks the right questions, and writes a valid sources.yaml — optionally scriptable via flags.
Motivation
- Schema errors are the top source of config frustration.
SourceConfigrequiresid/type/nameplus type-specific keys (disk:path;github:org+repos;web:urls;code:path+languages). A wizard can guarantee correctness instead of hoping the user reads the source. - The existing CLI
dewey source addonly supports github/web. Disk and code sources have no programmatic path — users must hand-edit YAML. - Discovery is the hard part. Users don't always know what's indexable: sibling repos, the current vault, docs directories, GitHub orgs they own, and web URLs buried in their markdown are all candidates. A read-only discovery pass can surface these as suggestions.
Proposed design
Command: /dewey-configure
A hybrid wizard + flags interaction model:
- Default (interactive): a 4-phase Q&A wizard driven by read-only discovery.
- Scripted: flags like
--add github --org X --repos a,b,cskip the wizard for CI/automation.
The 4 phases:
- Discover (read-only) — cheap, non-destructive recon:
git rev-parse --show-toplevel,git remote -v,gh auth statusls -d ../*/for sibling directories + per-siblinggit -C <dir> remote get-url origin- language manifests (
go.mod,package.json,Cargo.toml,pyproject.toml,setup.py,requirements.txt,pom.xml) ls docs/ *.mdfor markdown/vault density- read existing
.uf/dewey/sources.yaml+.uf/dewey/config.yaml(never clobber without review)
- Select — present discovered candidates (checkbox multi-select) grouped by source type.
- Configure — ask type-specific + cross-cutting questions with sane defaults (details below).
- Review + write — show the final YAML, validate against the
sourcepackage schema, then write via Read+Write tools (sodewey status/dewey doctorpass immediately).
Discovery → suggestions → questions, per source type
disk
- Signals: Logseq vault (
logseq/,.obsidian/,pages/+journals/, high.mddensity) → suggestpath: "."; code repo withdocs/→ suggest./docs; sibling dirs → candidate disk sources. - Skip:
.git,node_modules,vendor,build,dist,target,public. - Questions: which paths (pre-checked),
recursive(defaulttrue),ignorepatterns, id/name prefilleddisk-<slug>/<basename>.
github
- Signals:
originowner +upstreamowner (if a fork); if authed,gh repo list <owner>for full repo enumeration; siblings sharing an owner → consolidate into one org-level source. - Questions: org/owner (discovered options), repos (multi-select),
content(issues/pulls/readme, default all),refresh_interval(defaultdaily). - Never ask for or persist a token — it's resolved at runtime (GITHUB_TOKEN → GH_TOKEN →
gh auth token→ unauthenticated).
web
- Signals: extract URLs from repo markdown + manifests; classify docs vs homepage vs API vs image vs placeholder; filter out
localhost/127.0.0.1/private hosts/*.example.com/image+badge URLs/API endpoints (.googleapis.com,/v1/,/api/); group by host (onewebsource per host, multipleurls). - Questions: which discovered URLs (grouped/deduped),
depth(default1),name(hostname),rate_limit(default1s),sanitize_mode(defaultwarn). - Fallback: open prompt to paste URLs when nothing is discovered.
code
- Signals: language manifests, filtered against the chunker registry (only Go is registered today —
chunker.Languages()→["go"]).go.mod→ suggestcodewithlanguages: [go],path: ".". - Non-Go languages detected → tell the user only Go is currently supported and offer disk-as-markdown as an alternative.
- Monorepo → one code source per language dir.
- Questions:
path,languages(constrained),include/exclude(prefill excludevendor/,generated/),recursive.
Cross-cutting (always ask — never guess)
trust_tier— defaultauthoredsanitize_mode— defaultwarn(web/github),off(disk/code)refresh_interval— defaultdaily(github),weekly(web), none (disk/code)- intent — this repo only vs. siblings; cross-reference vs. standalone
Schema validation
Before writing, validate against the real source package schema (validateSourceConfig): id (required, unique), type, name, per-type config keys, valid trust_tier (authored/curated/validated/draft/untrusted) and sanitize_mode (warn/strict/off).
Delivery scope
Two artifacts:
.opencode/commands/dewey-configure.md— the slash command itself, following the existing format: YAML frontmatter (description:),# Command: /dewey-configure,## Description,## Usage, and a<protect>...## Instructions...</protect>block (the<protect>tags are honored bycli.goanddcp.jsonc).slash_commands.go— adddewey-configure.mdto thedeweySlashCommandsmap sodewey initscaffolds it into other repos. (Note:cli_test.go:751-752asserts every map entry gets scaffolded — may need a test update.)
Process
This will be implemented via an OpenSpec change (/opsx-propose), following the precedent set by openspec/changes/dewey-store-command/ (.openspec.yaml, design.md, proposal.md, specs/command-behavior.md, tasks.md) and openspec/changes/protect-tags-slash-commands/.
Out of scope (for now)
- Any source types beyond disk/github/web/code.
- New chunker languages (only Go is supported today).
- Changes to
dewey source additself.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNo status
Activity
fullsend-ai-triage commentedon Sep 14, 2026
🤖 Finished Triage · ✅ Success · Started 10:07 AM UTC · Completed 10:12 AM UTC
Commit:
d60b773· View workflow run →Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $0.94
fullsend-ai-triage commentedon Sep 14, 2026
Triage Summary
This is a well-specified feature request ready for implementation. A few notes for the implementer:
Delivery artifacts are clearly scoped: the slash command
.mdfile and aslash_commands.gomap entry. The existing test atcli_test.go:751-752asserts every map entry gets scaffolded — verify this passes after adding the new entry.Related issues:
Proposed test case:
Process note: The issue specifies implementation via OpenSpec (
/opsx-propose), following the pattern established byopenspec/changes/dewey-store-command/.Next steps:
/fs-code— agent creates a PR to implement this issue/fs-code <your instruction>— agent implements with your specific guidancejflowers commentedon Oct 31, 2026
Extension from the knowledge-lifecycle planning session that produced the companion issues #132 (
/dewey-publish), #133 (/dewey-distill), and #131 (the.gitignorebare-deweybug). This issue remains the home for/dewey-configure; the deltas below refine its design without changing its goal.1. Determinism governance now applies to the discovery phase. The repo has since added
.opencode/uf/packs/determinism.md+ thedeterminism-firstskill (DE-001/DE-003/DE-005/DE-007): mechanical steps — discovery enumeration, existence checks, output rendering — must live in an executable tool with tests, not prose wizard steps. Concretely, the Discover phase above should become a new DB-free CLI command (working namedewey analyze --json): git remotes → github-source candidates, markdown surfaces, language manifests filtered againstchunker.Languages(), sibling repos, existing config state — golden-tested. The wizard's judgment (selection, questions, YAML composition) stays in the command layer, with DE-007 seam-verification tasks in tasks.md.2. Scope extends beyond
sources.yaml. The user goal is "best configure the dewey sources and config files": the proposal should also cover.uf/dewey/config.yaml(embedding + synthesis — including proposing the new OpenAI-compatible synthesis provider, see #133) and.uf/dewey/knowledge-stores.yaml(curate stores). These are user-owned files: back up before write, and put a MANDATORY GATE before any overwrite.3. The verification path must account for the running server. While the MCP server runs it holds the exclusive
dewey.lockflock (store/store.go:105-120), sodewey doctor/dewey statusCLI verification fails beside it. Use MCPhealthfor live DB state, and verify newly written config via MCPindex(re-readssources.yamlevery run —tools/indexing.go:127,222) +health, without a server restart. Also note in the command output that new learning files are only re-ingested at server startup (main.go:1072).4. Suggested after-write flow: propose configs → MANDATORY GATE → write (with backup) → MCP
index→ MCPhealthverify → report.5. Packaging: planned as one OpenSpec change (
opsx/dewey-lifecycle-commands) together with #132 and #133 — adjust if scope demands.