Skip to content

Commit 0b84721

Browse files
committed
Merge branch 'kodu-güçlü-ve-zayıf-yanları-35031' into merge-probe-main-sync
2 parents 339ed47 + adb4ae7 commit 0b84721

130 files changed

Lines changed: 4126 additions & 10876 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: CI/CD Pipeline
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ["3.10", "3.11", "3.12"]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Cache dependencies
25+
uses: actions/cache@v4
26+
with:
27+
path: ~/.cache/pip
28+
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
29+
restore-keys: |
30+
${{ runner.os }}-pip-
31+
32+
- name: Install dependencies
33+
run: |
34+
python -m pip install --upgrade pip
35+
pip install -r requirements.txt
36+
37+
- name: Run tests
38+
run: |
39+
pytest tests/unit -v --cov=src --cov-report=xml
40+
41+
- name: Upload coverage
42+
uses: codecov/codecov-action@v4
43+
with:
44+
file: ./coverage.xml
45+
flags: unittests
46+
47+
lint:
48+
runs-on: ubuntu-latest
49+
steps:
50+
- uses: actions/checkout@v4
51+
52+
- name: Set up Python
53+
uses: actions/setup-python@v5
54+
with:
55+
python-version: "3.12"
56+
57+
- name: Install linters
58+
run: |
59+
pip install flake8 black mypy
60+
61+
- name: Run flake8
62+
run: flake8 src/ --max-line-length=120
63+
64+
- name: Run black check
65+
run: black --check src/

.gitignore

Lines changed: 39 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,48 @@
1-
# Runtime
2-
data/
3-
visual_memory/
4-
ops_backups/
5-
ops_logs/
6-
exports/
7-
luts/
8-
tmp/
9-
__pycache__/
1+
```
2+
# Compiled and build artifacts
103
*.pyc
11-
*.pyo
4+
__pycache__/
5+
*.o
6+
*.obj
127

13-
# Venv
8+
# Dependencies
149
.venv/
1510
venv/
11+
node_modules/
1612

17-
# DB & Index
18-
*.db
19-
*.sqlite
13+
# Logs and temp files
14+
*.log
15+
*.tmp
16+
*.swp
2017

21-
# Secrets
18+
# Environment
2219
.env
23-
*credentials*.json
24-
service-account-key.json
20+
.env.local
21+
.env.*
2522

26-
# Logs & PID
27-
*.log
28-
*.pid
29-
*.txt.bak
23+
# Editors
24+
.vscode/
25+
.idea/
26+
27+
# Coverage reports
28+
.coverage
29+
coverage/
30+
htmlcov/
31+
32+
# Python specific
33+
*.pyc
34+
__pycache__/
35+
*.pyo
36+
*.pyd
37+
.Python
38+
*.so
3039

31-
# Temp
32-
tmp_rome_*.txt
33-
tmp_rome_*.jpg
34-
# CV cache
35-
*.cv_cache.json
36-
.cv_cache.json
40+
# Distribution / packaging
41+
.Python
42+
*.egg-info/
43+
.eggs/
44+
dist/
45+
build/
46+
*.egg
47+
*.whl
48+
```

AI_COORDINATION.md

Lines changed: 62 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ This file is the canonical instruction set for ongoing YOOS-VIL product work.
44

55
## Product Goal
66

7-
YOOS-VIL must become a real reusable application, not a pile of one-off scripts.
7+
YOOS-VIL must be a reusable application surface, not a collection of one-off scripts.
88

9-
It must support two simultaneous use cases:
9+
It must support two simultaneous workflows:
1010

1111
1. Operator workflow:
12-
When Kemal says "attach images to post `POST_ID` with VIL", the protocol must run reliably end-to-end.
12+
When Kemal says "attach images to post `POST_ID` with VIL", the protocol must run reliably end to end.
1313
2. Reusable product workflow:
14-
Another user/project must be able to use the same engine with a different site profile and configuration.
14+
Another site/profile must be able to use the same engine through the same core surface.
1515

1616
## Non-Negotiable Rules
1717

18-
1. Do not optimize for repo appearance by breaking runtime behavior.
18+
1. Do not optimize repo appearance by breaking runtime behavior.
1919
2. Do not delete a file if any runtime path still imports or calls it.
2020
3. Do not report planned architecture as completed architecture.
2121
4. Unpushed work is not done.
@@ -26,9 +26,9 @@ It must support two simultaneous use cases:
2626
- what was tested
2727
- what failed
2828

29-
## Target Product Shape
29+
## Canonical Product Shape
3030

31-
The system should be split into three layers.
31+
The system is split into three layers.
3232

3333
### 1. Product Core
3434

@@ -67,13 +67,16 @@ Target modules:
6767
- `src/vil/app/api.py`
6868
- `src/vil/app/jobs.py`
6969
- `src/vil/app/health.py`
70+
- `src/vil/app/server.py`
71+
- `src/vil/app/state.py`
7072

7173
Responsibilities:
7274

7375
- CLI entrypoint
74-
- future API surface
76+
- HTTP surface
7577
- background job orchestration
7678
- structured health checks
79+
- job state tracking
7780

7881
### 3. Ops
7982

@@ -91,31 +94,34 @@ These are not the product surface.
9194

9295
## Canonical User Contract
9396

94-
The first stable public contract is CLI.
97+
The first stable public contracts are CLI and HTTP.
9598

96-
Target command shape:
99+
CLI shape:
97100

98101
```bash
99102
vil attach --site yoldaolmak --post 264459
100103
vil attach --site yoldaolmak --post 264459 --count 4 --lang tr --people-first
101104
vil review --site yoldaolmak --post 264459
105+
vil plan --site yoldaolmak --post 264459 --count 4 --people-first
106+
vil process --site yoldaolmak --post 264459 --count 4 --people-first
102107
vil health
108+
vil serve --host 127.0.0.1 --port 8040
103109
```
104110

105-
The engine behind `vil attach` must:
111+
HTTP shape:
106112

107-
1. fetch post context
108-
2. select relevant images
109-
3. reject watermark / stock-feeling / wrong-language assets
110-
4. prefer Turkish, human-centered assets when the content requires it
111-
5. process images
112-
6. upload media
113-
7. attach correct blocks to the target post
114-
8. return a structured result
113+
- `GET /health`
114+
- `POST /review`
115+
- `POST /plan`
116+
- `POST /process`
117+
- `POST /attach`
118+
- `POST /jobs/attach`
119+
- `GET /jobs`
120+
- `GET /jobs/{job_id}`
115121

116122
## Required Structured Output
117123

118-
The attach pipeline should return a machine-readable result with fields like:
124+
The attach pipeline should return machine-readable output with fields like:
119125

120126
- `site`
121127
- `post_id`
@@ -126,93 +132,67 @@ The attach pipeline should return a machine-readable result with fields like:
126132
- `warnings`
127133
- `duration_ms`
128134

129-
## Current Review Findings To Respect
135+
Job endpoints should additionally expose:
130136

131-
The current PR branch is not mergeable yet.
137+
- `job_id`
138+
- `status`
139+
- `created_at`
140+
- `updated_at`
141+
- `payload`
142+
- `result`
143+
- `error`
132144

133-
Verified problems:
145+
## Current State
134146

135-
1. `ops/yoos_vil_health.py` has a syntax error.
136-
2. `src/core/processor.py` still imports `yo_yoldaolmak_filter`, but that file was deleted.
137-
3. The branch uses Python 3.11 type syntax in places while this environment is currently running Python 3.9.
138-
4. The repo cleanup removed files more aggressively than the runtime contract allows.
147+
The branch has already completed the earlier stabilization work.
139148

140-
These must be fixed before any new cleanup wave.
149+
Current verified surface:
141150

142-
## Immediate Implementation Order
143-
144-
### Milestone 1: Stabilize Current PR
145-
146-
Goal: make the PR branch runnable again before further architecture changes.
147-
148-
Tasks:
149-
150-
1. Fix syntax/runtime breakages in the existing PR branch.
151-
2. Restore or relocate any runtime dependency that was deleted while still imported.
152-
3. Make the branch compatible with the declared Python version strategy.
153-
4. Run compile/import/tests and record exact results in `QWEN_STATUS.md`.
151+
- canonical `src/vil/*` package root exists
152+
- CLI exists and is tested
153+
- native `plan`, `process`, and `attach` contracts exist
154+
- minimal HTTP surface exists and is tested
155+
- async attach job registry exists and is tested
154156

155-
Acceptance:
157+
Still incomplete:
156158

157-
- no syntax errors
158-
- no missing imports in the canonical attach path
159-
- tests run or failures are explicitly recorded
159+
- auth on HTTP surface
160+
- persisted job store
161+
- richer native metadata parity with legacy path
162+
- gradual retirement of legacy internals in `src/main.py` and `src/core/*`
160163

161-
### Milestone 2: Define Canonical Package Layout
164+
## Immediate Implementation Order
162165

163-
Goal: move from ad hoc rename-only restructuring to a coherent package.
166+
### Milestone A: Secure the HTTP Surface
164167

165168
Tasks:
166169

167-
1. Introduce `src/vil/` as the canonical package root.
168-
2. Move current runtime code into `engine`, `providers`, `profiles`, `app`.
169-
3. Keep backward-compatibility wrappers only if needed temporarily.
170-
4. Remove dead code only after callers are updated.
171-
172-
Acceptance:
170+
1. Add token-based auth for HTTP endpoints.
171+
2. Keep health behavior explicit and intentional.
172+
3. Ensure error payloads stay structured.
173173

174-
- one clear package root
175-
- canonical CLI entrypoint exists
176-
- imports resolve without relying on deleted root scripts
177-
178-
### Milestone 3: Ship `vil attach`
179-
180-
Goal: one stable operator command for real post workflows.
174+
### Milestone B: Persist Job State
181175

182176
Tasks:
183177

184-
1. Implement `vil attach --site ... --post ...`
185-
2. Support `--count`, `--lang`, `--people-first`
186-
3. Return structured output
187-
4. Cover the attach flow with at least one integration-style test
188-
189-
Acceptance:
190-
191-
- command exists
192-
- command runs through the core path
193-
- behavior is documented
178+
1. Replace in-memory-only registry with persistent storage.
179+
2. Preserve job history across restarts.
180+
3. Keep the HTTP contract stable.
194181

195-
### Milestone 4: Add API Surface
196-
197-
Goal: prepare the system to behave like a reusable app.
182+
### Milestone C: Reduce Legacy Dependency
198183

199184
Tasks:
200185

201-
1. Add a minimal API layer, preferably FastAPI.
202-
2. Expose a job-style endpoint for image attachment.
203-
3. Keep API thin; business logic must remain in product core.
204-
205-
Acceptance:
206-
207-
- API wraps the same attach engine
208-
- no duplicated business logic
186+
1. Move more attach behavior from legacy orchestrator paths into `src/vil/engine/*`.
187+
2. Keep backward compatibility only where necessary.
188+
3. Remove dead code only after callers are updated.
209189

210190
## Do Not Do
211191

212192
- Do not invent a second parallel architecture.
213-
- Do not hide breakages behind README claims.
193+
- Do not hide runtime breakage behind README claims.
214194
- Do not delete domain-specific runtime modules just because they look messy.
215-
- Do not merge the current PR until Milestone 1 is truly complete.
195+
- Do not merge work that is untested in the current environment.
216196

217197
## Required Working Style
218198

0 commit comments

Comments
 (0)