Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ Top-level directories (one level down):
- Prefer frontend changes inside features/<domain>/ and keep API calls in services/.
- Trust these instructions and only search the repo if something is missing or contradicts these notes.

## Test Data Safety (Mandatory)

- Never read from or write to real user runtime files under `data/config/`, `data/projects/`, or `data/logs/` when running tests.
- For all automated tests, force the app to use a temporary user data root by setting `AUGQ_USER_DATA_DIR` to a temp directory (for example under `/tmp`).
- Tests and AI-generated test code must isolate runtime paths via environment variables before importing app modules so default config constants resolve into temp paths.
- When tests need projects/registry overrides, use temp values for `AUGQ_PROJECTS_ROOT` and `AUGQ_PROJECTS_REGISTRY` inside that same temp root.

## Branching and Release Policy

The repository uses the following branch layout by default:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ __marimo__/
# User configuration and data
resources/config/*.json
!resources/config/examples/*.json
!resources/config/model_presets.json
data/

# Build artifacts
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,13 @@ If you want to modify the frontend and see changes on the fly:

Configuration is JSON-based with environment variable precedence and interpolation.

- Machine-specific config (API credentials/endpoints): resources/config/machine.json
- Story-specific config (active project): resources/config/story.json
- Runtime machine config (local user setting, not tracked): data/config/machine.json
- Runtime story fallback config (local user setting, not tracked): data/config/story.json
- Runtime projects registry (local user setting, not tracked): data/config/projects.json
- Project-shipped model presets database (tracked): resources/config/model_presets.json
- Environment variables always override JSON values. JSON may include placeholders like ${OPENAI_API_KEY}.

Sample files can be found under resources/config/examples/:
Sample files can be found under resources/config/examples/ (tracked and for inspiration only; the app does not auto-load them as runtime config):

- resources/config/examples/machine.json
- resources/config/examples/story.json
Expand Down
100 changes: 100 additions & 0 deletions resources/config/model_presets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
"presets": [
{
"id": "openai-balanced-chat",
"name": "Balanced Chat",
"description": "Balanced default for general chat and co-writing tasks.",
"model_id_patterns": ["^gpt-4(\\.|-|o)", "^gpt-5"],
"parameters": {
"temperature": 0.7,
"top_p": 0.95,
"max_tokens": 2048,
"presence_penalty": 0,
"frequency_penalty": 0,
"stop": [],
"seed": null,
"top_k": null,
"min_p": null,
"extra_body": ""
}
},
{
"id": "reasoning-low-temp",
"name": "Reasoning (Low Temp)",
"description": "Conservative sampling for analysis/editing and deterministic behavior.",
"model_id_patterns": ["reason", "^o[13]", "^gpt-5"],
"parameters": {
"temperature": 0.2,
"top_p": 0.9,
"max_tokens": 4096,
"presence_penalty": 0,
"frequency_penalty": 0,
"stop": [],
"seed": 42,
"top_k": null,
"min_p": null,
"extra_body": ""
}
},
{
"id": "thinking-heavy-chat",
"name": "Thinking Heavy",
"description": "High-latency reasoning-focused setup. Usually a poor default for writing flow.",
"model_id_patterns": ["thinking", "reasoning"],
"parameters": {
"temperature": 0.6,
"top_p": 0.95,
"max_tokens": 4096,
"presence_penalty": 0,
"frequency_penalty": 0,
"stop": [],
"seed": null,
"top_k": null,
"min_p": null,
"extra_body": "{\"reasoning\": {\"enabled\": true}}"
},
"warnings": {
"writing": "This preset is optimized for deep reasoning and may slow writing flow or produce overlong internal reasoning output."
}
},
{
"id": "qwen35-thinking-default",
"name": "Qwen 3.5 Thinking",
"description": "Qwen3.5 recommended sampling for default thinking mode.",
"model_id_patterns": ["^qwen(/|-)?.*3\\.5", "Qwen3\\.5", "Qwen/Qwen3\\.5"],
"parameters": {
"temperature": 0.6,
"top_p": 0.95,
"max_tokens": null,
"presence_penalty": 0.0,
"frequency_penalty": 0.0,
"stop": [],
"seed": null,
"top_k": 20,
"min_p": 0.0,
"extra_body": "{\"repetition_penalty\": 1.0}"
},
"warnings": {
"writing": "This is a thinking-mode preset and should not be used for WRITING; prefer the non-thinking preset for drafting flow."
}
},
{
"id": "qwen35-instruct-non-thinking",
"name": "Qwen 3.5 Instruct (Non-Thinking)",
"description": "Qwen3.5 recommended non-thinking sampling profile with direct responses.",
"model_id_patterns": ["^qwen(/|-)?.*3\\.5", "Qwen3\\.5", "Qwen/Qwen3\\.5"],
"parameters": {
"temperature": 0.7,
"top_p": 0.8,
"max_tokens": null,
"presence_penalty": 1.5,
"frequency_penalty": 0.0,
"stop": [],
"seed": null,
"top_k": 20,
"min_p": 0.0,
"extra_body": "{\"repetition_penalty\": 1.0, \"chat_template_kwargs\": {\"enable_thinking\": false}}"
}
}
]
}
5 changes: 3 additions & 2 deletions resources/schemas/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ This directory contains JSON Schema files for validating configuration and proje
## Files

- `story-v2.schema.json`: Schema for `story.json` files in project directories, with metadata.version = 2.
- `projects.schema.json`: Schema for `resources/config/projects.json`.
- `machine.schema.json`: Schema for `resources/config/machine.json`.
- `projects.schema.json`: Schema for runtime `projects.json` settings.
- `machine.schema.json`: Schema for runtime `data/config/machine.json` settings.
- `model_presets.schema.json`: Schema for tracked preset DB `resources/config/model_presets.json`.

## Usage

Expand Down
60 changes: 60 additions & 0 deletions resources/schemas/machine.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,57 @@
"model": {
"type": "string"
},
"temperature": {
"type": ["number", "null"],
"minimum": 0,
"maximum": 2
},
"top_p": {
"type": ["number", "null"],
"minimum": 0,
"maximum": 1
},
"max_tokens": {
"type": ["integer", "null"],
"minimum": 1
},
"presence_penalty": {
"type": ["number", "null"],
"minimum": -2,
"maximum": 2
},
"frequency_penalty": {
"type": ["number", "null"],
"minimum": -2,
"maximum": 2
},
"stop": {
"type": ["array", "null"],
"items": {
"type": "string"
}
},
"seed": {
"type": ["integer", "null"]
},
"top_k": {
"type": ["integer", "null"],
"minimum": 1
},
"min_p": {
"type": ["number", "null"],
"minimum": 0,
"maximum": 1
},
"extra_body": {
"type": ["string", "null"]
},
"preset_id": {
"type": ["string", "null"]
},
"writing_warning": {
"type": ["string", "null"]
},
"is_multimodal": {
"type": ["boolean", "null"]
},
Expand All @@ -49,6 +100,15 @@
"selected": {
"type": "string",
"description": "The selected model name"
},
"selected_chat": {
"type": "string"
},
"selected_writing": {
"type": "string"
},
"selected_editing": {
"type": "string"
}
},
"required": ["models", "selected"]
Expand Down
46 changes: 46 additions & 0 deletions resources/schemas/model_presets.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://example.com/model_presets.schema.json",
"title": "Model Preset Database",
"type": "object",
"properties": {
"presets": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"model_id_patterns": {
"type": "array",
"items": {
"type": "string"
}
},
"parameters": {
"type": "object",
"additionalProperties": true
},
"warnings": {
"type": "object",
"properties": {
"writing": {
"type": "string"
}
},
"additionalProperties": true
}
},
"required": ["id", "name", "description", "model_id_patterns", "parameters"]
}
}
},
"required": ["presets"]
}
Loading
Loading