QQsci-skill/references/configuration.md

97 lines
2.9 KiB
Markdown

# QQsci Configuration
Use this file when QQsci needs DeepSeek, Zotero, Obsidian, or QQnote access.
## Ownership model
QQsci is the top-level configuration owner for manuscript work. Store the
primary DeepSeek, Zotero, Obsidian, and QQnote routing settings in:
```text
config/config.local.json
```
Never commit `config/config.local.json`, print secrets, or ask the user to paste
API keys into chat.
QQnote remains independently usable. When QQnote is run by itself, it may use
its own environment variables, the vault `.env`, or AwesomeGPT/Zotero
preferences. When QQnote is called from QQsci, QQsci should inject its own
configuration into QQnote's expected environment variables.
## Config precedence
For QQsci-controlled manuscript workflows:
1. Existing process environment variables override everything.
2. QQsci `config/config.local.json`.
3. QQsci `config/config.template.json` only for defaults, never secrets.
4. QQnote standalone fallbacks only when QQsci config is absent or the user asks
to run QQnote independently.
For QQnote standalone workflows:
1. Existing process environment variables.
2. Vault `.env`.
3. AwesomeGPT/Zotero profile preferences.
4. Any QQnote-specific local config if QQnote later adds one.
## Environment mapping
QQsci config maps to QQnote's existing environment variable interface:
| QQsci config | QQnote env |
|---|---|
| `deepseek.api_key` | `AWESOMEGPT_API_KEY` |
| `deepseek.base_url` | `AWESOMEGPT_BASE_URL` |
| `deepseek.model` | `AWESOMEGPT_MODEL` |
| `zotero.web_api_key` | `ZOTERO_API_KEY` |
| `zotero.user_id` | `ZOTERO_USER_ID` |
The Zotero local API remains:
```text
http://127.0.0.1:23119/api/users/0
```
unless the user explicitly changes it.
## Calling QQnote from QQsci
Prefer the wrapper:
```powershell
py "$env:USERPROFILE\.codex\skills\qqsci\scripts\run_qqnote_with_qqsci_config.py" --script summarize_zotero_table -- --vault "C:\Users\qyh15\Documents\Obsidian Vault" --item-keys "SXAIQUJT X7GJZ627"
```
The wrapper loads QQsci local config, sets QQnote-compatible environment
variables for the child process, and does not print secrets.
Use `--script generate_zotero_ai_note` when QQnote should create Zotero child
notes.
Use `--script summarize_zotero_table` when QQsci needs a compact paper table.
Use `--script audit_zotero_ai_notes` only for QQnote note-state maintenance, not
for QQsci's manuscript reasoning.
## What belongs in QQsci
QQsci owns:
- manuscript keyword extraction
- strong/weak related-paper screening
- target-journal positioning
- comparative review against strong papers
- submission-package audit
- figure, format, spelling, and terminology checks
- DOI-only Word citation comments
QQnote owns:
- generating Zotero child-note summaries
- generating paper comparison tables from Zotero items
- optional QQnote note-state maintenance when explicitly requested
QQnote output is an input to QQsci, not the decision engine.