wip: preserve local engine and agent workflow changes before ganjihong refactor integration

This commit is contained in:
2026-09-09 17:08:24 +08:00
parent a5c3ec1f36
commit 387b99e255
112 changed files with 3543 additions and 12177 deletions
+20 -37
View File
@@ -20,53 +20,36 @@ CDSL_OPENAI_REASONING_EFFORT=medium
```
Use `low`, `medium`, or `high` according to the latency/cost versus quality
tradeoff. The setting is sent as Chat Completions' `reasoning_effort` field to
authoring, streaming, and visual-review requests. Leave it empty to use the
tradeoff. The setting is sent as the provider's `reasoning_effort` field to
requirements analysis and Authoring CDSL generation. Leave it empty to use the
provider/model default. The selected OpenAI-compatible endpoint must support
the requested value.
## Autonomous CDSL Agent Configuration
The autonomous agent writes one frozen free-form `requirements.md`, then
observes, measures, renders and appends one CDSL feature at a time. Its author
uses normal function calls; no provider strict JSON Schema capability or
complete modelling DAG is required. Candidate fragments are rebuilt in a
staging directory through `cdsl_only` before a checkpoint can be committed.
Each task has one bounded workflow:
Final publication requires a separately configured vision-capable review model
and the Python OpenCascade/Pillow technical renderer. The agent may build and
inspect intermediate checkpoints without image review; a final run fails
closed if its independent review configuration is unavailable.
```text
request analysis -> complete cad.author.v1 -> server compilation -> runtime build
-> at most two complete repairs -> final or best-effort publication
```
The model outputs only local body/feature names and declarative selectors.
The server validates strict schemas, allocates Runtime CDSL identities,
compiles references, executes dependencies, and preserves the last executable
prefix. STEP is the primary artifact; GLB and the CPU-only OpenCascade/Pillow
render bundle are generated from the same published revision.
```dotenv
# Must name one configured provider and one model listed in that provider's
# CDSL_<PROVIDER>_VISION_MODELS setting. It is intentionally not inferred
# from the authoring model.
CDSL_REVIEW_PROVIDER=deepseek
CDSL_REVIEW_MODEL=deepseek-v4-flash-vision-exp
CDSL_DEEPSEEK_VISION_MODELS=deepseek-v4-flash-vision-exp
# Install Python rendering dependencies. The renderer reads the revision STEP
# file and creates canonical images without a browser or GPU driver.
pip install -r requirements.txt
# Limits apply to the current checkpoint head, never to total task complexity.
CDSL_AGENT_TOOL_CALLS_PER_CYCLE=12
CDSL_AGENT_CANDIDATE_ATTEMPTS_PER_HEAD=3
CDSL_AGENT_CONSECUTIVE_NO_PROGRESS_LIMIT=6
CDSL_AGENT_MAX_FEATURES_PER_FRAGMENT=6
CDSL_AGENT_CONTEXT_CHAR_LIMIT=24000
CDSL_AGENT_RENDER_CACHE=true
```
The author chooses each coherent 1-6 feature batch. Every rebuilt batch is
rendered and independently reviewed before it can become a checkpoint; only
an accepted reviewer verdict advances the working model. Every checkpoint is rebuilt from its fully materialized CDSL through the
`cdsl_only` runtime. Checkpoint GLB files are preview-only; STEP, CDSL, and
reports are available only after the task reaches `COMPLETED`.
The backend assigns feature and sketch IDs, appends causal dependencies and
expands only opaque current-snapshot selector tokens. It does not compile
geometry templates or correct workplanes, profiles, sizes, directions or
boolean semantics authored by the model. Failed candidates remain auditable
but never become revisions.
The initial generation plus two repairs are the only model calls allowed after
requirements analysis. A repair returns a complete replacement Authoring CDSL
and may only alter diagnosed features. Runtime selector ambiguity, missing
selectors, and unavailable dependencies produce stable diagnostics rather than
topology guesses. Requirement compliance is reported independently as
`pass`, `fail`, `pending`, or `not_applicable`; a partial executable model is
still published after the repair budget is exhausted.