Skip to content

Commit 3c92bb4

Browse files
YZLLMclaude
andcommitted
feat(S8): akis sonunda "uygulama calisti mi" kaniti
Plan asamasi S8, son madde. Pipeline sonunda bu soruyu soran HICBIR sey yoktu. Yerine gecen olcut hasDeliverable'di: proje kokunde gorunur bir giris var mi diye bakiyor; icerige, derlemeye, calismaya BAKMIYOR. Okuma hata verirse true donuyor. CANLI KANIT: cuzdan projesinde 27 dosya vardi - bilesenler, sayfalar, oturum, tema, i18n - ama uygulama hic acilmadi, ekran bombostu. "Teslim edilebilir var" sayildi ve akis bunu hic sormadi. Iki degisiklik: 1) hasDeliverable UC DURUMLU hale geldi (deliverableProbe: yes/no/unknown). hasDeliverable artik onun unknown->true saran ince kabugu - bugunku fail-open davranis birebir korundu, mevcut testler yesil. Ayrimin sebebi: "okuyamadim" ile "gercekten bos" ayni sey degil. 2) Ozete CALISMA KANITI satiri eklendi. Dort pozitif sinyal toplaniyor: E2E gecti mi, Faz 6 gorsel taramasi ekrani bos BULMADI mi, giris zinciri taramasi saglam mi, calisma zamani hatasi kaydedilmedi mi. Hepsi ZATEN uretilen sinyaller - yeni olcum yok, tek yapilan bir satirda toplamak. YANLIS ALARM YASAGI metnin kendisine islendi: hicbir kanit yoksa satir "uygulamanin calistigi bu kosuda kanitlanmadi" diyor, "calismiyor" DEMIYOR. Kanit yoklugu, calismadiginin kaniti degildir. Ayrica her sinyal POZITIF kanit ariyor: gorsel tarama hic kosmadiysa "ekran bos degil" kaniti YOK sayiliyor, "ekran bos" diye iddia edilmiyor. DAVRANIS REGRESYONU: kanit verilmezse satir hic basilmiyor (eski cikti birebir); hukum semantigine dokunulmadi; hasDeliverable cagiranlari etkilenmedi. 21 + 40 test yesil. Bununla plandaki sekiz bulgunun hepsi kapandi. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 301a3db commit 3c92bb4

7 files changed

Lines changed: 194 additions & 8 deletions

File tree

‎README.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ ortak controller'a dayanır:
6868
| 16 | E2E Testler (UI varsa) | mechanical |
6969
| 17 | Sızma Testi — **otomatik koşar** (hızlı profil); tam tarama 🛡️ butonuyla | — |
7070

71+
**Her akış sonunda "çalışma kanıtı" satırı:** MyCL artık iterasyon sonunda uygulamanın gerçekten
72+
çalıştığına dair pozitif kanıt topladığını yazar — E2E geçti mi, ekran boş değil mi, giriş zinciri
73+
sağlam mı, çalışma zamanı hatası var mı. Hiçbiri yoksa "uygulamanın çalıştığı bu koşuda
74+
kanıtlanmadı" der; **"çalışmıyor" demez** — kanıt yokluğu çalışmadığının kanıtı değildir. Daha önce
75+
bu soruyu soran hiçbir şey yoktu: yerine geçen ölçüt "proje klasöründe görünür bir şey var mı"ydı ve
76+
içeriğe bakmıyordu.
77+
7178
**Uygulama hata fırlatıyorsa onay bir kez sorulur:** Faz 6 incelemesinde, uygulama açılırken
7279
çalışma zamanı hatası kaydedildiyse çıplak bir `tamam` doğrudan kabul edilmez — MyCL kaç hata
7380
gördüğünü söyleyip bir kez teyit ister. Boş ekran kapısıyla aynı sözleşme: kapı değil bilinçli onay,

‎orchestrator/src/harness-verdict.ts‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,3 +251,31 @@ export function computeVerdict(
251251
summary,
252252
};
253253
}
254+
255+
/**
256+
* SAF: bu iterasyonun olaylarından "uygulama gerçekten çalıştı mı" kanıtlarını topla.
257+
*
258+
* Hiçbiri yeni ölçüm yapmaz — hepsi ZATEN üretilen sinyaller. Bugüne kadar pipeline sonunda bu
259+
* soruyu soran bir şey yoktu; yerine geçen ölçüt "klasörde görünür bir şey var mı"ydı ve içeriğe
260+
* bakmıyordu (canlı kanıt: 27 dosyalık proje, hiç açılmayan uygulama).
261+
*
262+
* Her alan POZİTİF kanıt arar: "kanıt yok" ile "çalışmıyor" farklı şeylerdir ve özet metni bu
263+
* ayrımı korur.
264+
*/
265+
export function collectRunEvidence(events: AuditEvent[]): {
266+
e2ePassed: boolean;
267+
screenNotBlank: boolean;
268+
entryGraphOk: boolean;
269+
noRuntimeErrors: boolean;
270+
} {
271+
const has = (p: (e: AuditEvent) => boolean): boolean => events.some(p);
272+
return {
273+
e2ePassed: has((e) => e.event === "phase-16-complete" && !String(e.detail ?? "").includes("skipped"))
274+
&& !has((e) => e.event === "phase-16-skipped"),
275+
// Faz 6 görsel taraması koştu VE boş bulmadı. Hiç koşmadıysa kanıt YOK (iddia da yok).
276+
screenNotBlank:
277+
has((e) => e.event === "visual-diff") && !has((e) => String(e.detail ?? "").includes("blank_screen")),
278+
entryGraphOk: has((e) => e.event === "entry-graph-pass"),
279+
noRuntimeErrors: !has((e) => e.event === "runtime-error-recorded"),
280+
};
281+
}

‎orchestrator/src/index.ts‎

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@ import {
5454
readAuditLogTail,
5555
wasPipelineCompleted,
5656
} from "./audit.js";
57-
import { computeVerdict, eventsSince, type HarnessVerdict } from "./harness-verdict.js";
57+
import {
58+
collectRunEvidence,
59+
computeVerdict,
60+
eventsSince,
61+
type HarnessVerdict,
62+
} from "./harness-verdict.js";
5863
import { classifyOpenedFolder, hasDeliverable, buildCodebaseSnapshot } from "./phase-1-codebase-probe.js";
5964
import { buildPipelineEndLines } from "./pipeline-end-summary.js";
6065
import {
@@ -10438,6 +10443,7 @@ async function emitPipelineEndSummary(state: State): Promise<void> {
1043810443
// (soft_complete_after_fail) yazıp devam eder. computeVerdict audit'ten
1043910444
// gerçeği çıkarır: gate-fail veya güvenlik-skip varsa hüküm PASS değildir.
1044010445
let verdict: HarnessVerdict | null = null;
10446+
let runEvidence: ReturnType<typeof collectRunEvidence> | null = null;
1044110447
try {
1044210448
// SARI-GATE KÖK FIX (YZLLM 2026-06-20, canlı remax_BO iter#2 bulgusu): verdict YALNIZ BU İTERASYONUN
1044310449
// olaylarına baksın. audit.jsonl append-only + tüm iterasyonları tutar → eski computeVerdict TÜM log'u
@@ -10457,10 +10463,13 @@ async function emitPipelineEndSummary(state: State): Promise<void> {
1045710463
`⛔ Çalışma kaydının bütünlüğü doğrulanamadı (${anchor.file}): ${anchor.reason}. Bu koşu yeşil sayılamaz.`,
1045810464
);
1045910465
}
10460-
verdict = computeVerdict(eventsSince(allEvents, state.iteration_started_at ?? 0), {
10466+
const iterEvents = eventsSince(allEvents, state.iteration_started_at ?? 0);
10467+
verdict = computeVerdict(iterEvents, {
1046110468
deliverableExists,
1046210469
...(anchor.status === "tampered" ? { auditTampered: true } : {}),
1046310470
});
10471+
// Çalışma kanıtı: hepsi ZATEN üretilen sinyaller; tek yaptığımız bir satırda toplamak.
10472+
runEvidence = collectRunEvidence(iterEvents);
1046410473
} catch (err) {
1046510474
// Pipeline-sonu hüküm (sessiz-fallback denetimi): audit okunamazsa verdict null kalır → özet hükümsüz.
1046610475
// log.warn→log.error + GÖRÜNÜR (kullanıcı gate sonuçlarını elle kontrol etsin).
@@ -10476,7 +10485,13 @@ async function emitPipelineEndSummary(state: State): Promise<void> {
1047610485
}
1047710486
emitChatMessage(
1047810487
"system",
10479-
buildPipelineEndLines({ intent, v16, verdict, costs }).join("\n"),
10488+
buildPipelineEndLines({
10489+
intent,
10490+
v16,
10491+
verdict,
10492+
costs,
10493+
...(runEvidence ? { evidence: runEvidence } : {}),
10494+
}).join("\n"),
1048010495
);
1048110496
// Frontend'e yapılandırılmış hüküm — sidebar başarısız gate'lere ⚠️ bassın,
1048210497
// header kısmî/başarısız çipi göstersin (ordinal ✅ "sessiz yeşil" yalanını düzeltir).

‎orchestrator/src/phase-1-codebase-probe.ts‎

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -457,16 +457,34 @@ const NON_DELIVERABLE_TOP = new Set([
457457
// görev (`.eslintrc` tek başına, dizinsiz) hâlâ sayılmaz; nadir + kullanıcı yeniden gönderebilir (kabul edilen denge).
458458
const DELIVERABLE_DOTDIRS = new Set([".github", ".husky", ".vscode", ".circleci", ".gitlab", ".devcontainer"]);
459459

460-
export async function hasDeliverable(projectRoot: string): Promise<boolean> {
460+
/**
461+
* Proje kökünde görünür bir çıktı var mı — ÜÇ DURUMLU.
462+
*
463+
* `hasDeliverable` bunun `unknown → true` saran ince kabuğudur (bugünkü fail-open davranışı birebir
464+
* korunur). Ayrımın sebebi (2026-09-18): "okuyamadım" ile "gerçekten boş" aynı şey değil; özet
465+
* bunları ayırt edebilsin ki okunamayan bir kökü sessizce "dolu" saymak yerine dürüstçe söyleyebilsin.
466+
*
467+
* NOT (kapsam): bu ölçüt İÇERİĞE bakmaz — klasörde görünür bir şey olması uygulamanın ÇALIŞTIĞI
468+
* anlamına gelmez. Canlı kanıt: 27 dosyalık bir proje vardı, uygulama hiç açılmıyordu. "Çalışıyor mu"
469+
* sorusunun kanıtı pipeline sonu özetindeki ayrı kanıt satırıdır.
470+
*/
471+
export async function deliverableProbe(projectRoot: string): Promise<"yes" | "no" | "unknown"> {
461472
try {
462473
const entries = await fs.readdir(projectRoot, { withFileTypes: true });
463474
return entries.some(
464475
(e) =>
465476
(!e.name.startsWith(".") && !NON_DELIVERABLE_TOP.has(e.name)) ||
466477
(e.isDirectory() && DELIVERABLE_DOTDIRS.has(e.name)),
467-
);
478+
)
479+
? "yes"
480+
: "no";
468481
} catch (e) {
469-
log.warn("phase-1-probe", "hasDeliverable: proje kökü okunamadı → true (boş-build guard'ı atlanır)", { error: String(e) });
470-
return true;
482+
log.warn("phase-1-probe", "deliverableProbe: proje kökü okunamadı → unknown", { error: String(e) });
483+
return "unknown";
471484
}
472485
}
486+
487+
export async function hasDeliverable(projectRoot: string): Promise<boolean> {
488+
// unknown → true: boş-build guard'ı atlanır (bugünkü fail-open davranışı korunur).
489+
return (await deliverableProbe(projectRoot)) !== "no";
490+
}

‎orchestrator/src/pipeline-end-summary.ts‎

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,25 @@ export interface PipelineEndCost {
2121
cache_read_input_tokens: number;
2222
}
2323

24+
/**
25+
* "Uygulama bu koşuda GERÇEKTEN çalıştı mı?" sorusuna dair POZİTİF kanıtlar.
26+
*
27+
* NEDEN (2026-09-18): pipeline sonunda bu soruyu soran hiçbir şey yoktu. Yerine geçen ölçüt
28+
* "proje klasöründe görünür bir şey var mı"ydı — içeriğe, derlemeye, çalışmaya bakmıyor. Canlı
29+
* kanıt: 27 dosyalık bir proje vardı, uygulama hiç açılmadı, ekran bomboştu ve akış bunu hiç
30+
* sormadı. Buradaki alanlar zaten ÜRETİLEN sinyallerdir; tek yaptığımız onları bir satırda toplamak.
31+
*/
32+
export interface RunEvidence {
33+
/** Faz 16 E2E gerçekten koştu ve geçti. */
34+
e2ePassed: boolean;
35+
/** Faz 6 görsel taraması ekranı boş BULMADI (yani bir şey render olmuş). */
36+
screenNotBlank: boolean;
37+
/** Uygulamanın giriş zinciri tarandı ve sağlam çıktı. */
38+
entryGraphOk: boolean;
39+
/** Bu koşuda çalışma zamanı hatası kaydedilmedi. */
40+
noRuntimeErrors: boolean;
41+
}
42+
2443
export interface PipelineEndInput {
2544
/** state.intent_summary (boş olabilir). */
2645
intent: string;
@@ -30,6 +49,8 @@ export interface PipelineEndInput {
3049
verdict: HarnessVerdict | null;
3150
/** Faz-bazında token harcaması (boş olabilir). */
3251
costs: PipelineEndCost[];
52+
/** Uygulamanın çalıştığına dair pozitif kanıtlar (verilmezse satır basılmaz). */
53+
evidence?: RunEvidence;
3354
}
3455

3556
/**
@@ -113,6 +134,24 @@ export function buildPipelineEndLines(input: PipelineEndInput): string[] {
113134
lines.push("• Sonuç: ✅ Tamamlandı — tüm gate'ler yeşil, güvenlik tarandı.");
114135
}
115136

137+
// ÇALIŞMA KANITI (2026-09-18). Dikkat: buradaki metin "çalışmıyor" DEMEZ — kanıt yokluğu,
138+
// çalışmadığının kanıtı değildir (yanlış alarm yasağı). Söylediği tek şey şu: bu koşuda
139+
// uygulamanın çalıştığına dair pozitif bir kanıt toplanamadı.
140+
const ev = input.evidence;
141+
if (ev) {
142+
const kanitlar = [
143+
ev.e2ePassed ? "E2E geçti" : null,
144+
ev.screenNotBlank ? "ekran boş değil" : null,
145+
ev.entryGraphOk ? "giriş zinciri sağlam" : null,
146+
ev.noRuntimeErrors ? "çalışma zamanı hatası yok" : null,
147+
].filter((x): x is string => x !== null);
148+
lines.push(
149+
kanitlar.length > 0
150+
? `• 🚦 Çalışma kanıtı: ${kanitlar.join(" · ")}`
151+
: "• 🚦 Çalışma kanıtı: uygulamanın çalıştığı bu koşuda kanıtlanmadı.",
152+
);
153+
}
154+
116155
// Token gözlemi — toplam + per-faz döküm (regresyon görünür).
117156
if (costs.length > 0) {
118157
const inTok = costs.reduce((s, c) => s + c.input_tokens, 0);

‎orchestrator/test/harness-verdict.test.ts‎

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, expect, it } from "vitest";
2-
import { computeVerdict, eventsSince } from "../src/harness-verdict.js";
2+
import { collectRunEvidence, computeVerdict, eventsSince } from "../src/harness-verdict.js";
33
import type { AuditEvent } from "../src/types.js";
44

55
function ev(phase: number, event: string, detail?: string): AuditEvent {
@@ -364,3 +364,40 @@ describe("Faz 16 atlaması hükme yansır (yalnız gerçek boşlukta)", () => {
364364
expect(v.summary).toContain("gate başarısız");
365365
});
366366
});
367+
368+
// S8: kanıt toplayıcı — hepsi ZATEN üretilen sinyaller, yeni ölçüm yok.
369+
describe("collectRunEvidence", () => {
370+
const e = (event: string, detail?: string): AuditEvent =>
371+
({ ts: 1, phase: 0, event, caller: "x", detail }) as AuditEvent;
372+
373+
it("E2E koştu ve atlanmadıysa kanıt sayılır", () => {
374+
expect(collectRunEvidence([e("phase-16-complete")]).e2ePassed).toBe(true);
375+
});
376+
377+
it("E2E ATLANDIYSA kanıt sayılmaz (complete damgası olsa bile)", () => {
378+
const r = collectRunEvidence([e("phase-16-skipped", "install_failed"), e("phase-16-complete")]);
379+
expect(r.e2ePassed).toBe(false);
380+
});
381+
382+
it("görsel tarama koşmadıysa 'ekran boş değil' kanıtı YOK (iddia da yok)", () => {
383+
expect(collectRunEvidence([]).screenNotBlank).toBe(false);
384+
});
385+
386+
it("görsel tarama koştu ve boş bulmadıysa kanıt var", () => {
387+
expect(collectRunEvidence([e("visual-diff", "routes=1")]).screenNotBlank).toBe(true);
388+
});
389+
390+
it("boş ekran işaretlendiyse kanıt YOK", () => {
391+
const r = collectRunEvidence([e("visual-diff"), e("phase-6-deferred", "blank_screen")]);
392+
expect(r.screenNotBlank).toBe(false);
393+
});
394+
395+
it("giriş zinciri taraması geçtiyse kanıt var", () => {
396+
expect(collectRunEvidence([e("entry-graph-pass")]).entryGraphOk).toBe(true);
397+
});
398+
399+
it("çalışma zamanı hatası kaydı varsa o kanıt düşer", () => {
400+
expect(collectRunEvidence([e("runtime-error-recorded", "RUNTIME_VITE x")]).noRuntimeErrors).toBe(false);
401+
expect(collectRunEvidence([]).noRuntimeErrors).toBe(true);
402+
});
403+
});

‎orchestrator/test/pipeline-end-summary.test.ts‎

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { describe, expect, it } from "vitest";
55
import {
66
buildPipelineEndLines,
77
type PipelineEndInput,
8+
type RunEvidence,
89
} from "../src/pipeline-end-summary.js";
910
import type { HarnessVerdict } from "../src/harness-verdict.js";
1011
import type { Phase16Verification } from "../src/playwright-setup.js";
@@ -249,3 +250,44 @@ describe("E2E atlaması özette görünür", () => {
249250
expect(lines({ verdict: verdict({ e2eSkipped: [] }) })).toContain("✅ Tamamlandı");
250251
});
251252
});
253+
254+
// S8 (2026-09-18): pipeline sonunda "uygulama gerçekten çalıştı mı?" diye soran hiçbir şey yoktu.
255+
// Yerine geçen ölçüt "proje klasöründe görünür bir şey var mı"ydı — içeriğe, derlemeye, çalışmaya
256+
// bakmıyor. CANLI KANIT: 27 dosyalık bir proje vardı, uygulama hiç açılmadı, ekran bomboştu ve akış
257+
// bunu hiç sormadı. Aşağıdaki testler satırın hem VAR olduğunu hem de ASLA "çalışmıyor" demediğini
258+
// kilitler — kanıt yokluğu, çalışmadığının kanıtı değildir.
259+
describe("çalışma kanıtı satırı", () => {
260+
const ev = (over: Partial<RunEvidence> = {}): RunEvidence => ({
261+
e2ePassed: false,
262+
screenNotBlank: false,
263+
entryGraphOk: false,
264+
noRuntimeErrors: false,
265+
...over,
266+
});
267+
268+
it("kanıt varsa hangileri olduğu yazılır", () => {
269+
const out = lines({ evidence: ev({ e2ePassed: true, entryGraphOk: true }) });
270+
expect(out).toContain("Çalışma kanıtı");
271+
expect(out).toContain("E2E geçti");
272+
expect(out).toContain("giriş zinciri sağlam");
273+
});
274+
275+
it("hiç kanıt yoksa DÜRÜST metin — 'çalışmıyor' DEMEZ", () => {
276+
const out = lines({ evidence: ev() });
277+
expect(out).toContain("kanıtlanmadı");
278+
expect(out).not.toContain("çalışmıyor");
279+
});
280+
281+
it("dört kanıt da varsa dördü de listelenir", () => {
282+
const out = lines({
283+
evidence: ev({ e2ePassed: true, screenNotBlank: true, entryGraphOk: true, noRuntimeErrors: true }),
284+
});
285+
for (const s of ["E2E geçti", "ekran boş değil", "giriş zinciri sağlam", "çalışma zamanı hatası yok"]) {
286+
expect(out).toContain(s);
287+
}
288+
});
289+
290+
it("REGRESYON KİLİDİ: kanıt verilmezse satır hiç basılmaz (eski çıktı birebir)", () => {
291+
expect(lines({})).not.toContain("Çalışma kanıtı");
292+
});
293+
});

0 commit comments

Comments
 (0)