Commit Graph

3 Commits

Author SHA1 Message Date
admin 695c6c451d feat: add approved stack lifecycle endpoints 2026-06-23 17:18:30 +00:00
admin 0c3e88ac2f feat: add create mode for new files
Auto-detects create vs edit based on whether target_path exists.
Edit jobs use unified diff/patch (existing behaviour).
Create jobs ask the model to output the complete new file, validated
by file type (_validate_output handles .py compile, .html tag check,
generic non-empty check).

- _resolve_target: handles /opt/sites/ and /opt/stacks/ paths
- _CREATOR_SYSTEM + _build_create_prompt + _ask_creator: full-file output
- _validate_output: replaces direct _syntax_check calls in the loop
- run_coding_loop: branches on mode, stores mode on job dict
- approve: mkdir parents for new paths, skip backup if no original
- submit_task: initialise mode field as None

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 12:39:24 +00:00
admin 7fa1fb9e99 feat: switch Qyburn to unified diff output + patch apply
Full-file replacement confirmed failing at all model sizes (tested up to
codestral:22b on 619-line file). Model hallucinates a new short file instead
of reproducing the original with changes applied.

New approach: model outputs only the unified diff (10-20 lines), applied
programmatically via `patch`. Works at any file size, uses ~154 tokens vs
~700+ previously, and succeeds on first attempt.

- Add `patch` binary to Dockerfile (apt install)
- Replace `_extract_code` with `_extract_diff`
- Add `_apply_diff` using subprocess patch
- Rewrite `_CODER_SYSTEM` to ask for diff format
- Rewrite `_build_prompt` to return plain string (no prefill dict)
- Rewrite `_ask_coder` to drop prefill assistant message
- Reduce num_predict 16384 → 4096 (diff output is short)
- Update `run_coding_loop` inner loop to apply diff then syntax-check result
- Update `_write_handoff` to show last diff instead of last full-file attempt

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 12:23:12 +00:00