GetClaps
Ücretsiz DenetimFiyatlandırmaSözlükAkademi
  1. Ana sayfa
  2. /Akademi
  3. /L02 · How we build: git, pull requests, tests, CI, waves and agents

Ana sayfa / Akademi / L02 · How we build: git, pull requests, tests, CI, waves and agents

L02Bölüm A · TemellerTemelKod doğrulama tarihi: 2026-12-04

How we build: git, pull requests, tests, CI, waves and agents

How branches, worktrees, layered tests, one verification manifest, wave briefs and independent reviews turn code into verified progress.

19 dk·3699 kelime·6 soru·36 terim·docs/lessons/02-how-we-build.md
Ön koşul:L01 · The big picture: what we are building and how the pieces fit
Tüm derslere dön
●

Ders içerikleri İngilizce yayınlanır (OD-23)

Sayfa çerçevesi Türkçe ve İngilizce olarak sunulur. Teknik ders metinleri, kod örnekleri ve kendini sına soruları doğrudan ortak kaynak dosyalarından İngilizce okunur; hukuk ve ürün terimlerinde Türkçe karşılıklar yer alır.

0%
▲Yanıtlanan sorular
0 / 6
—
○Doğruluk oranı
Henüz yanıt yok

Bu dersteki bölümler

  1. 1.Why this matters
  2. 2.The ideas
  3. 3.How this repository does it
  4. 4.What went wrong once
  5. 5.Try it yourself
  6. 6.Check yourself
  7. 7.Words to know
  8. 8.Go deeper

Why this matters

A green check mark means nothing if it only passes on one developer's laptop or hides skipped checks. For a founder, the risk is making hiring, marketing or launch decisions on top of test counts that collapse the moment someone else clones the code. That happened here at the end of Wave 44: the log recorded 8,810 of 8,810 verified checks, yet on a clean Linux clone two static gates and 22 root security tests failed for portability reasons, and GitHub Actions had never run. Waves 45 through 48 rebuilt the engineering workflow around one shared verification command, clean-machine CI, isolated agent worktrees and independent reviews. Once you know how this workflow operates, you can read any pull request, re-run the checks yourself on Windows and tell real evidence from an unverified claim.

The ideas

Commits, branches, merges and worktrees

Think of Git as a bound accounting ledger where pages are never torn out. Each saved step is a commit identified by a unique hash (such as 957bb99) that links back to the commit before it. Because even a one-character change produces a completely different hash, naming the commit next to a test result binds that result to exact file bytes.

To keep unfinished work from breaking the shared baseline (main), every task runs on its own branch. When several builders work in parallel on one machine, checking out different branches inside one folder would constantly overwrite each other's files. A Git worktree solves that by creating a separate folder linked to the same repository history, each checked out to its own branch:

text
repository (.git object history shared once)
  ├── main checkout         -> branch: main
  ├── worktree A            -> branch: wave48/a-dispatch
  ├── worktree B            -> branch: wave48/b-executor
  └── worktree lessons      -> branch: wave49/lessons-and-dictionary

When a branch finishes, a merge joins its commits back into the target branch. If two branches edited the same lines differently, Git pauses with a merge conflict and asks a person to choose. The subtler trap is a conflict-free merge that breaks the program anyway: if branch A removes an import because it moved the last caller, while branch B adds a brand-new caller on another line, Git merges both files with zero textual conflicts and produces broken code that nobody wrote or reviewed. That is why typecheck and tests must always run again after every merge.

Two quiet file rules keep Windows and Linux checkouts identical across every worktree:

  • Line endings: Windows defaults to CRLF while Linux expects LF. Pinning eol=lf in .gitattributes stops shell scripts and file hashes from breaking across operating systems.
  • Dependencies: committing a lockfile (pnpm-lock.yaml) and installing with --frozen-lockfile ensures every workstation and CI runner installs the exact same dependency versions.

Pull requests, stacked pull requests and review

A pull request is the review gate where one branch proposes to merge into another on GitHub. It puts four things on one screen: the line-by-line diff, the automated CI status checks, reviewer comments and the author's evidence block.

Sometimes a new wave depends directly on code from a previous branch that has not merged yet. Instead of piling ten thousand lines into one unreadable review, engineers use a stacked pull request: PR 2 branches from PR 1 so reviewers inspect only PR 2's own diff, and PR 2 merges into main right after PR 1 lands.

Automated tests check what computers can verify, while code review and independent review check what tests miss: whether the design matches the brief, whether an authorization check was forgotten, or whether a test assertion was quietly weakened just to turn green. A common mistake is letting the author act as sole reviewer; here, read-only reviewers inspect every workstream before integration.

Three layers of tests: what each proves

No single test style catches every bug. Running one fast test layer alone gives false confidence, while running only slow browser suites makes daily editing crawl. This repository stacks three complementary test layers:

LayerReal example in this repoSpeedWhat it provesWhat it cannot prove
Unit testpackages/approvals/test/intent-binding.test.tsMillisecondsPure rules: budget step math, hash binding, tax kuruş rounding, validator edge casesSQL triggers, row-level security, browser cookies or CORS headers
Real-database testpackages/db/test/ suitesSecondsActual PostgreSQL 18 FORCE ROW LEVEL SECURITY, triggers, role grants and migration parityBrowser rendering, CSP headers or frontend-to-API wiring
Browser journeytests/browser/sign-in-journey-e2e.mjsTens of secondsReal Chromium walking sign-in, cookies, CORS, API, PostgreSQL and screen state end to endLive third-party provider approvals (uses a local fake provider)

Three discipline habits keep those tests honest:

  1. Failing test first: when fixing a bug, write a test that reproduces the defect and watch it fail red before writing the fix.
  2. Self-test: every custom static checking tool tests itself on built-in good and bad fixtures (--self-test) before scanning the real repository.
  3. Negative control: include deliberate must-fail cases (such as an intentionally slow cubic workload in the scaling helper) so you know the checker still catches faults.

What "green" means, what it does not, and continuous integration

A green build means every check that executed passed on that commit in that environment. It never proves anything about a check that did not execute, a feature that has no test yet or a live server that has not been provisioned.

That is why this repository enforces one strict rule: every step prints passed, failed or not run with its exact reason, and a not run step is never counted as passed. A trustworthy receipt always records four items: the commit hash, the exact command run, the machine or CI environment and the exact passed/failed/not-run totals.

Running checks from your laptop is fast, yet laptops accumulate hidden local state. Continuous integration runs the exact same checks automatically on clean Linux servers hosted by GitHub Actions whenever code is pushed or a pull request opens. From a user's seat, you run bash tools/verify locally and GitHub Actions runs the matching CI workflow (.github/workflows/verify.yml). Lesson 13 examines the manifest internals, deployment checks and incident runbooks in depth.

How a wave runs: briefs, parallel agents, reports and depth-first rules

Building with parallel AI coding agents looks chaotic unless roles and handoffs are crystal clear. Every wave follows the same seven-step pipeline:

text
1. Briefs         Integrator writes wave README + disjoint WS briefs + shared contracts
       |
2. Parallel build Each coding agent works on its own branch inside its own worktree
       |
3. Reports        Each agent commits locally and writes docs/waveNN/reports/<WS>-REPORT.md
       |
4. Review         Independent read-only reviewers audit diffs against briefs and rules
       |
5. Wiring         Closing wiring workstream connects parts and proves them in Chromium
       |
6. Integration    Integrator merges branches, fixes merge seams, runs bash tools/verify
       |
7. Pull request   PR opens with receipts, CI runs green, LOG.md records verified outcome

Understanding four artifacts lets you inspect any wave in five minutes:

  • How to read a workstream brief: start at the file ownership list, the exact problem statement and the required tests. If a builder touched files outside that list, ask why.
  • How to read an agent report: skip past marketing summaries and look straight at four sections—exact commands with pass/fail/not-run counts, any pre-existing test changed with its reason, explicit deviations from the brief, and open risks.
  • Why wiring is its own workstream: separate branches for storage, API and UI routinely pass alone and fail where they meet. Giving wiring its own owner and browser journey catches seam bugs before merge.
  • Why smaller verified beats larger unverified: owner decision OD-18 established depth-first building—finishing one verifiable slice a customer can actually complete beats adding ten half-wired screens. Every closed wave is recorded honestly in the project log (LOG.md).

Two governance mechanisms keep both the product and these lessons aligned over time. First, whenever builders hit a business, legal or product trade-off they cannot decide alone, they log options in docs/OWNER-DECISIONS.md and pause for the founders' answer rather than guessing silently. Second, these lessons and dictionary entries stay tied to live code through the drift gate: if a later wave renames or deletes a file cited by a lesson, node tools/learning/build.mjs --check fails in CI until the lesson is corrected and its verified date updated.

How this repository does it

Every part of this workflow is backed by concrete files and scripts on this branch today:

  • One manifest, local and CI identical: tools/verify calls tools/run-gates.mjs, which reads all 70 ordered steps from tools/gates.manifest.json across eight groups (core, static, suites, postgres, deploy, scanners, build, browser). .github/workflows/verify.yml runs the exact same commands on GitHub Actions, and tools/check-gate-parity.mjs fails CI if the manifest and workflow ever drift apart. Removing gate parity would let local checks and CI silently diverge again.
  • Portable line endings and PostgreSQL discovery: .gitattributes locks pure LF endings across operating systems. tools/lib/pg-local.mjs is the single helper that finds PostgreSQL 18 server binaries (via PG_BIN_DIR, PATH or default install folders) and checks the actual server version rather than the client binary; tools/check-pg-discovery-single-helper.mjs fails if any test file re-introduces a private copy.
  • Machine-independent performance checks: tools/lib/linear-time.mjs measures how runtime scales between 1/8 input size and full input size across interleaved runs (failing at 24x growth, with a confirmation retry on noise and a built-in cubic negative control), replacing 214 flaky millisecond ceilings.
  • Invariants instead of growth-only counts: tools/check-surface-invariants.mjs enforces structural invariants after Wave 46 D retired 141 minimum-count assertions under OD-18.
  • Wave records and pull requests: docs/wave46/README.md, docs/wave47/README.md, docs/wave48/README.md and docs/wave49/README.md organize every workstream brief and report alongside docs/wave49/briefs/COMMON.md, .github/PULL_REQUEST_TEMPLATE.md, docs/VERIFICATION.md and LOG.md.
  • The learning drift gate: tools/learning/build.mjs validates lesson syntax, exact-case repo paths, bidirectional dictionary links, tone rules and generated outputs (check_learning_sources in tools/gates.manifest.json). Removing it would let lessons quietly drift out of sync with the code, just as earlier ADRs did.
◆

Not built yet

Automated GitHub branch protection rules requiring the verify job before merge are designed, not enforced by code inside this repository (they live in GitHub repository settings). Wave 48 was verified locally at 69 of 69 steps on the owners' Windows workstation, and nothing is deployed to production yet; the three manual owner runbooks with a real Meta developer app and the external security review (issue 97) remain open.

What went wrong once

The headline number that only passed on one laptop

  • What happened: The Wave 44 log reported 8,810 / 8,810 verified checks. When re-run from a clean Linux clone, two of 38 static gates and 22 of 1,626 root security tests failed, 108 of 168 API suites died without PostgreSQL 18 binaries, and roughly 1,750 tests were not wired into CI at all.
  • How it was noticed: The independent review in docs/INDEPENDENT-REVIEW-2026-12-02.md cloned the repository cleanly on Linux and ran every check before changing a line.
  • Cause in plain words: "Verified" meant verified on one authoring Windows machine; one gate hashed Windows CRLF bytes, another followed links outside the repository, and growth-only gates rewarded adding files while CI had never run.
  • Fix: Wave 45 E built the shared manifest (tools/gates.manifest.json) and bash tools/verify, pinned LF in .gitattributes and recorded the correction openly in LOG.md. Wave 46 D enabled CI on push (OD-17) and retired 141 growth-only count assertions (OD-18).
  • General lesson: A big check count is not proof; a result only counts as verified when a clean clone can reproduce it from one documented command.

The import dropped in a clean Git merge

  • What happened: After merging Wave 48 workstream B (Meta budget executor) and workstream A (dispatch process), apps/api/src/server.ts called new KekKeyring(...) while its import line only imported zeroizeBuffer from @{product}/vault.
  • How it was noticed: Immediately after the merge (fixed two minutes later in commit 957bb99).
  • Cause in plain words: Workstream A moved token refresh out of server.ts and removed the now-unused KekKeyring import; workstream B left the import untouched and added a new KekKeyring call for budget execution. Git merged both branches with zero conflicts by taking A's shorter import line and B's new call.
  • Fix: Restored KekKeyring to the import line in server.ts and re-ran typecheck and tests.
  • General lesson: Zero merge conflicts means the text lines did not collide—not that the combined program compiles. Always run pnpm typecheck and tests after every merge.

The test that pointed at the owners' live Windows database folder

  • What happened: A Wave 45 test for the dev-stack launcher set TMPDIR to isolate its temporary PostgreSQL folder. On Windows, Node's os.tmpdir() ignores TMPDIR and reads TEMP and TMP, so the test resolved its data directory straight to the owners' live development cluster folder and attempted pg_ctl start against it. Because that cluster was already running, the start failed without changing or stopping anything.
  • How it was noticed: Three Wave 46 agents hit six failing tests on Windows; one agent verified read-only (PID file, port, server log) that the owners' server was untouched, and agent E isolated the cause with a one-line os.tmpdir() check (docs/wave46/reports/E-REPORT.md).
  • Cause in plain words: A Linux-only isolation variable (TMPDIR) silently did nothing on Windows.
  • Fix: The test now sets TEMP, TMP and TMPDIR and asserts before touching disk that os.tmpdir() points inside its disposable directory; browser journeys also explicitly refuse ports 3000, 4000, 5432 and any live dev-cluster path.
  • General lesson: Tests must prove they are isolated before acting, and when anything unexpected points near real data, stop retrying and verify read-only first.

Duplicate PostgreSQL helpers and flaky wall-clock ceilings

  • What happened: Two hidden test-infrastructure faults built up across earlier waves. First, 184 test files carried 20 slightly different copy-pasted PostgreSQL discovery snippets; 14 of them silently accepted PostgreSQL 17 instead of PostgreSQL 18. Second, 214 timing assertions checked hard millisecond ceilings (such as under 250 ms), failing under CPU contention on CI while letting two real quadratic regular expressions hide on a fast laptop.
  • How it was noticed: The independent review flagged duplicated helpers and timing flakes; Wave 46 D and Wave 48 D audited every call site (docs/wave46/reports/D-REPORT.md, docs/wave48/reports/D-REPORT.md).
  • Cause in plain words: Test helpers were copy-pasted instead of shared, and wall-clock time measured machine speed instead of algorithmic growth.
  • Fix: Wave 48 D replaced 181 private helpers with one import of tools/lib/pg-local.mjs (plus tools/check-pg-discovery-single-helper.mjs so duplicates cannot return). Wave 46 D replaced 214 wall-clock budgets with tools/lib/linear-time.mjs, which immediately exposed and drove fixes for two real quadratic regex defects.
  • General lesson: Test the real property you care about (server version 18, linear scaling), share one helper and add a gate so copy-paste drift cannot return.

Try it yourself

All four commands below are read-only and safe on Windows. None start servers, none touch ports 3000, 4000 or 5432, and none modify tracked files.

Step 1: read recent commits and see the exact hashes in PowerShell

bash
git log --oneline -n 8

You should see eight short lines, each starting with a seven-character commit hash followed by its scoped commit message. Notice how every verification receipt cites that exact short hash.

Step 2: print the full verification manifest plan in Git Bash

bash
bash tools/verify --list

Git Bash lists all 70 verification steps grouped into core, static, suites, postgres, deploy, scanners, build and browser, showing each step's exact command and prerequisites (needs) without executing any of them.

Step 3: verify that local verify and GitHub Actions CI match 1:1 in PowerShell

bash
node tools/check-gate-parity.mjs

You should see a clean passing summary confirming that every entry in tools/gates.manifest.json matches .github/workflows/verify.yml in both directions.

Step 4: run the learning drift gate on this very lesson in PowerShell

bash
node tools/learning/build.mjs --check-file docs/lessons/02-how-we-build.md

The command validates this file's front matter, section order, links, exact-case repository paths, tone rules and dictionary sync, printing PASS when every rule holds.

Check yourself

0 / 6

Q1.Two branches merge cleanly with zero Git merge conflicts. Why must you still run typecheck and tests before trusting the merge?

Q2.A developer reports "All checks green locally" after running bash tools/verify, and the summary shows 65 passed, 0 failed, 5 not run (pg18 missing). How should you read that report?

Q3.Which test layer catches a missing CORS header that stops the browser from sending a custom request header on a POST request?

Q4.Why did Wave 46 replace 214 absolute millisecond ceilings (such as "under 250 ms") with growth-ratio checks in tools/lib/linear-time.mjs?

Q5.Why did the founders retire 141 growth-only minimum-count assertions under owner decision OD-18?

Q6.A bug is reported in an approval ceiling check. What is the safest order of steps when fixing it?

Words to know

36
agent report

The structured summary a builder writes at the end of a workstream naming changes, exact test receipts, modified tests and risks.

Nasıl geliştiriyoruzSözlükte incele
branchTR: dal

An independent line of Git commits that lets one change develop safely without modifying the main line until reviewed.

Nasıl geliştiriyoruzSözlükte incele
brief (workstream)

The written design specification handed to a builder before coding, stating scope, file ownership, decisions, rules and required tests.

Nasıl geliştiriyoruzSözlükte incele
browser journey

An end-to-end test where a real Chromium browser walks a full user path against a live API, web build and PostgreSQL database.

Nasıl geliştiriyoruzSözlükte incele
CI workflow

The YAML configuration file defining the jobs and ordered shell steps a continuous integration server executes automatically.

Nasıl geliştiriyoruzSözlükte incele
code reviewTR: kod incelemesi

Reading and questioning another builder's diff before merge to catch logic defects, missed edge cases and contract drift.

Nasıl geliştiriyoruzSözlükte incele
coding agent

An AI builder assigned one scoped workstream in its own branch and worktree, accountable for tests and a written report.

Nasıl geliştiriyoruzSözlükte incele
commit

One saved snapshot of the repository's files in Git history, identified uniquely by a cryptographic hash such as 957bb99.

Nasıl geliştiriyoruzSözlükte incele
continuous integrationCITR: sürekli entegrasyon

Automatically running the repository's build and verification checks on a clean hosted machine on every push or pull request.

Nasıl geliştiriyoruzSözlükte incele
depth-first

The engineering policy (OD-18) of completing one thin real customer journey end to end before adding more screens or documents.

Nasıl geliştiriyoruzSözlükte incele
drift gate

The automated check that fails whenever a lesson or dictionary entry links a moved file or generated learning outputs fall out of sync.

Nasıl geliştiriyoruzSözlükte incele
failing test first

The habit of writing a test that fails because of a defect before writing the fix, proving the test actually catches the bug.

Nasıl geliştiriyoruzSözlükte incele
Git

The distributed version-control tool that records every file change as immutable commits across branches and worktrees.

Nasıl geliştiriyoruzSözlükte incele
.gitattributes

The repository configuration file telling Git how to handle line endings and file attributes consistently on every OS.

Nasıl geliştiriyoruzSözlükte incele
GitHub Actions

GitHub's built-in continuous integration service that runs workflow jobs on clean virtual machines.

Nasıl geliştiriyoruzSözlükte incele
green build

The state where every executed automated check passed (green), as opposed to at least one failing check (red).

Nasıl geliştiriyoruzSözlükte incele
independent reviewTR: bağımsız inceleme

A thorough code and test audit conducted by someone who did not write the code, starting from fresh reproduction.

Nasıl geliştiriyoruzSözlükte incele
integrator

The lead role that designs a wave's briefs, coordinates shared contracts, merges agent branches, re-verifies everything and updates the log.

Nasıl geliştiriyoruzSözlükte incele
line endingTR: satır sonu

The invisible control character sequence marking the end of each line in a text file: LF on Linux/macOS versus CRLF on Windows.

Nasıl geliştiriyoruzSözlükte incele
lockfileTR: kilit dosyası

The committed file pinning the exact version and integrity hash of every installed dependency across all machines.

Nasıl geliştiriyoruzSözlükte incele
mergeTR: birleştirme

Combining commits from one Git branch into another; Git joins non-overlapping lines automatically, creating new combined code.

Nasıl geliştiriyoruzSözlükte incele
merge conflictTR: birleştirme çakışması

A situation where two branches edited the same lines differently, forcing a human to reconcile them before completing the merge.

Nasıl geliştiriyoruzSözlükte incele
negative controlTR: negatif kontrol

A deliberate broken input or disabled guard that a check must reject, proving the check actually catches the fault it claims to prevent.

Nasıl geliştiriyoruzSözlükte incele
not run

The explicit status for a check whose prerequisite tool was absent, reported openly with its reason and never counted as passed.

Nasıl geliştiriyoruzSözlükte incele
project log

The chronological diary in LOG.md recording what each wave built, where checks ran, what passed and what remains open.

Nasıl geliştiriyoruzSözlükte incele
pull requestPR

A proposal on GitHub to merge one branch into another, attaching the diff, CI check statuses, review comments and test evidence.

Nasıl geliştiriyoruzSözlükte incele
real-database test

An automated test running against an actual temporary PostgreSQL 18 server rather than an in-memory JavaScript stand-in.

Nasıl geliştiriyoruzSözlükte incele
receipt (evidence)TR: kanıt

Verifiable proof backing an engineering claim: the exact commit hash, command run, environment and observed pass/fail output.

Nasıl geliştiriyoruzSözlükte incele
self-test

A built-in test mode where a verification script runs on synthetic pass and fail fixtures first to prove the checker itself is not broken.

Nasıl geliştiriyoruzSözlükte incele
stacked pull request

A pull request built on top of another unmerged branch so dependent work can be reviewed in small chunks and merged in order.

Nasıl geliştiriyoruzSözlükte incele
typecheckTR: tip kontrolü

Running the TypeScript compiler across every package to catch broken imports, missing properties and type mismatches without running code.

Nasıl geliştiriyoruzSözlükte incele
unit testTR: birim testi

A fast automated test verifying one small function or rule in isolation, with no database, browser or network.

Nasıl geliştiriyoruzSözlükte incele
waveTR: dalga

One numbered, goal-focused delivery cycle split into parallel workstreams, independently reviewed and merged as one coherent milestone.

Nasıl geliştiriyoruzSözlükte incele
wiring (workstream)

The closing workstream of a wave that connects separately built storage, API and UI pieces and proves them end to end in a real browser.

Nasıl geliştiriyoruzSözlükte incele
workstream

One cleanly scoped slice of a wave assigned to a single builder with explicit file ownership, its own branch and its own worktree.

Nasıl geliştiriyoruzSözlükte incele
worktree

An additional checkout folder linked to the same Git repository on its own branch so multiple builders work in parallel safely.

Nasıl geliştiriyoruzSözlükte incele

Go deeper

  • Verification contract, manifest and wave history: docs/VERIFICATION.md, tools/gates.manifest.json, .github/workflows/verify.yml, LOG.md and docs/INDEPENDENT-REVIEW-2026-12-02.md.
  • Wave briefs and reports: docs/wave46/README.md, docs/wave47/README.md, docs/wave48/README.md, docs/wave49/README.md and docs/wave49/briefs/COMMON.md.
  • Lesson authoring and drift gate rules: AUTHORING.md and tools/learning/build.mjs.
  • Archived lessons this lesson replaces (historical only, not a source of current facts): archived lesson 11, archived lesson 13, archived lesson 16, archived lesson 17, archived lesson 23 and the archive index.
  • Official external documentation: Git documentation, git-worktree reference, GitHub Actions documentation, Vitest documentation, Playwright documentation and pnpm documentation.
◆

NOT LEGAL OR TAX ADVICE · Açık karar kapıları dürüstlüğü

Bu müfredat öğrenme amaçlıdır; hukuk veya vergi danışmanlığı değildir. #3 hukuk ve mali müşavir onayı, #21 keşif görüşmeleri, OD-01 marka tescil kontrolü ve canlı dağıtım henüz tamamlanmamıştır. ISO-27001 / SOC 2: UNOBTAINED. Sıfır canlı müşteri veya canlı reklam harcaması iddia edilmez.

Önceki ders: L01Sonraki ders: L03

L02 · Part A · foundation · Verified 2026-12-04 · 19 min

How we build: git, pull requests, tests, CI, waves and agents

How branches, worktrees, layered tests, one verification manifest, wave briefs and independent reviews turn code into verified progress.

Bu müfredat öğrenme amaçlıdır; hukuk veya vergi danışmanlığı değildir. #3 hukuk ve mali müşavir onayı, #21 keşif görüşmeleri, OD-01 marka tescil kontrolü ve canlı dağıtım henüz tamamlanmamıştır. ISO-27001 / SOC 2: UNOBTAINED. Sıfır canlı müşteri veya canlı reklam harcaması iddia edilmez.

Why this matters

A green check mark means nothing if it only passes on one developer's laptop or hides skipped checks. For a founder, the risk is making hiring, marketing or launch decisions on top of test counts that collapse the moment someone else clones the code. That happened here at the end of Wave 44: the log recorded 8,810 of 8,810 verified checks, yet on a clean Linux clone two static gates and 22 root security tests failed for portability reasons, and GitHub Actions had never run. Waves 45 through 48 rebuilt the engineering workflow around one shared verification command, clean-machine CI, isolated agent worktrees and independent reviews. Once you know how this workflow operates, you can read any pull request, re-run the checks yourself on Windows and tell real evidence from an unverified claim.

The ideas

Commits, branches, merges and worktrees

Think of Git as a bound accounting ledger where pages are never torn out. Each saved step is a commit identified by a unique hash (such as 957bb99) that links back to the commit before it. Because even a one-character change produces a completely different hash, naming the commit next to a test result binds that result to exact file bytes.

To keep unfinished work from breaking the shared baseline (main), every task runs on its own branch. When several builders work in parallel on one machine, checking out different branches inside one folder would constantly overwrite each other's files. A Git worktree solves that by creating a separate folder linked to the same repository history, each checked out to its own branch:

repository (.git object history shared once)
  ├── main checkout         -> branch: main
  ├── worktree A            -> branch: wave48/a-dispatch
  ├── worktree B            -> branch: wave48/b-executor
  └── worktree lessons      -> branch: wave49/lessons-and-dictionary

When a branch finishes, a merge joins its commits back into the target branch. If two branches edited the same lines differently, Git pauses with a merge conflict and asks a person to choose. The subtler trap is a conflict-free merge that breaks the program anyway: if branch A removes an import because it moved the last caller, while branch B adds a brand-new caller on another line, Git merges both files with zero textual conflicts and produces broken code that nobody wrote or reviewed. That is why typecheck and tests must always run again after every merge.

Two quiet file rules keep Windows and Linux checkouts identical across every worktree:

  • Line endings: Windows defaults to CRLF while Linux expects LF. Pinning eol=lf in .gitattributes stops shell scripts and file hashes from breaking across operating systems.
  • Dependencies: committing a lockfile (pnpm-lock.yaml) and installing with --frozen-lockfile ensures every workstation and CI runner installs the exact same dependency versions.

Pull requests, stacked pull requests and review

A pull request is the review gate where one branch proposes to merge into another on GitHub. It puts four things on one screen: the line-by-line diff, the automated CI status checks, reviewer comments and the author's evidence block.

Sometimes a new wave depends directly on code from a previous branch that has not merged yet. Instead of piling ten thousand lines into one unreadable review, engineers use a stacked pull request: PR 2 branches from PR 1 so reviewers inspect only PR 2's own diff, and PR 2 merges into main right after PR 1 lands.

Automated tests check what computers can verify, while code review and independent review check what tests miss: whether the design matches the brief, whether an authorization check was forgotten, or whether a test assertion was quietly weakened just to turn green. A common mistake is letting the author act as sole reviewer; here, read-only reviewers inspect every workstream before integration.

Three layers of tests: what each proves

No single test style catches every bug. Running one fast test layer alone gives false confidence, while running only slow browser suites makes daily editing crawl. This repository stacks three complementary test layers:

LayerReal example in this repoSpeedWhat it provesWhat it cannot prove
Unit testpackages/approvals/test/intent-binding.test.tsMillisecondsPure rules: budget step math, hash binding, tax kuruş rounding, validator edge casesSQL triggers, row-level security, browser cookies or CORS headers
Real-database testpackages/db/test/ suitesSecondsActual PostgreSQL 18 FORCE ROW LEVEL SECURITY, triggers, role grants and migration parityBrowser rendering, CSP headers or frontend-to-API wiring
Browser journeytests/browser/sign-in-journey-e2e.mjsTens of secondsReal Chromium walking sign-in, cookies, CORS, API, PostgreSQL and screen state end to endLive third-party provider approvals (uses a local fake provider)

Three discipline habits keep those tests honest:

  1. Failing test first: when fixing a bug, write a test that reproduces the defect and watch it fail red before writing the fix.
  2. Self-test: every custom static checking tool tests itself on built-in good and bad fixtures (--self-test) before scanning the real repository.
  3. Negative control: include deliberate must-fail cases (such as an intentionally slow cubic workload in the scaling helper) so you know the checker still catches faults.

What "green" means, what it does not, and continuous integration

A green build means every check that executed passed on that commit in that environment. It never proves anything about a check that did not execute, a feature that has no test yet or a live server that has not been provisioned.

That is why this repository enforces one strict rule: every step prints passed, failed or not run with its exact reason, and a not run step is never counted as passed. A trustworthy receipt always records four items: the commit hash, the exact command run, the machine or CI environment and the exact passed/failed/not-run totals.

Running checks from your laptop is fast, yet laptops accumulate hidden local state. Continuous integration runs the exact same checks automatically on clean Linux servers hosted by GitHub Actions whenever code is pushed or a pull request opens. From a user's seat, you run bash tools/verify locally and GitHub Actions runs the matching CI workflow (.github/workflows/verify.yml). Lesson 13 examines the manifest internals, deployment checks and incident runbooks in depth.

How a wave runs: briefs, parallel agents, reports and depth-first rules

Building with parallel AI coding agents looks chaotic unless roles and handoffs are crystal clear. Every wave follows the same seven-step pipeline:

1. Briefs         Integrator writes wave README + disjoint WS briefs + shared contracts
       |
2. Parallel build Each coding agent works on its own branch inside its own worktree
       |
3. Reports        Each agent commits locally and writes docs/waveNN/reports/<WS>-REPORT.md
       |
4. Review         Independent read-only reviewers audit diffs against briefs and rules
       |
5. Wiring         Closing wiring workstream connects parts and proves them in Chromium
       |
6. Integration    Integrator merges branches, fixes merge seams, runs bash tools/verify
       |
7. Pull request   PR opens with receipts, CI runs green, LOG.md records verified outcome

Understanding four artifacts lets you inspect any wave in five minutes:

  • How to read a workstream brief: start at the file ownership list, the exact problem statement and the required tests. If a builder touched files outside that list, ask why.
  • How to read an agent report: skip past marketing summaries and look straight at four sections—exact commands with pass/fail/not-run counts, any pre-existing test changed with its reason, explicit deviations from the brief, and open risks.
  • Why wiring is its own workstream: separate branches for storage, API and UI routinely pass alone and fail where they meet. Giving wiring its own owner and browser journey catches seam bugs before merge.
  • Why smaller verified beats larger unverified: owner decision OD-18 established depth-first building—finishing one verifiable slice a customer can actually complete beats adding ten half-wired screens. Every closed wave is recorded honestly in the project log (LOG.md).

Two governance mechanisms keep both the product and these lessons aligned over time. First, whenever builders hit a business, legal or product trade-off they cannot decide alone, they log options in docs/OWNER-DECISIONS.md and pause for the founders' answer rather than guessing silently. Second, these lessons and dictionary entries stay tied to live code through the drift gate: if a later wave renames or deletes a file cited by a lesson, node tools/learning/build.mjs --check fails in CI until the lesson is corrected and its verified date updated.

How this repository does it

Every part of this workflow is backed by concrete files and scripts on this branch today:

  • One manifest, local and CI identical: tools/verify calls tools/run-gates.mjs, which reads all 70 ordered steps from tools/gates.manifest.json across eight groups (core, static, suites, postgres, deploy, scanners, build, browser). .github/workflows/verify.yml runs the exact same commands on GitHub Actions, and tools/check-gate-parity.mjs fails CI if the manifest and workflow ever drift apart. Removing gate parity would let local checks and CI silently diverge again.
  • Portable line endings and PostgreSQL discovery: .gitattributes locks pure LF endings across operating systems. tools/lib/pg-local.mjs is the single helper that finds PostgreSQL 18 server binaries (via PG_BIN_DIR, PATH or default install folders) and checks the actual server version rather than the client binary; tools/check-pg-discovery-single-helper.mjs fails if any test file re-introduces a private copy.
  • Machine-independent performance checks: tools/lib/linear-time.mjs measures how runtime scales between 1/8 input size and full input size across interleaved runs (failing at 24x growth, with a confirmation retry on noise and a built-in cubic negative control), replacing 214 flaky millisecond ceilings.
  • Invariants instead of growth-only counts: tools/check-surface-invariants.mjs enforces structural invariants after Wave 46 D retired 141 minimum-count assertions under OD-18.
  • Wave records and pull requests: docs/wave46/README.md, docs/wave47/README.md, docs/wave48/README.md and docs/wave49/README.md organize every workstream brief and report alongside docs/wave49/briefs/COMMON.md, .github/PULL_REQUEST_TEMPLATE.md, docs/VERIFICATION.md and LOG.md.
  • The learning drift gate: tools/learning/build.mjs validates lesson syntax, exact-case repo paths, bidirectional dictionary links, tone rules and generated outputs (check_learning_sources in tools/gates.manifest.json). Removing it would let lessons quietly drift out of sync with the code, just as earlier ADRs did.
◆

Not built yet

Automated GitHub branch protection rules requiring the verify job before merge are designed, not enforced by code inside this repository (they live in GitHub repository settings). Wave 48 was verified locally at 69 of 69 steps on the owners' Windows workstation, and nothing is deployed to production yet; the three manual owner runbooks with a real Meta developer app and the external security review (issue 97) remain open.

What went wrong once

The headline number that only passed on one laptop

  • What happened: The Wave 44 log reported 8,810 / 8,810 verified checks. When re-run from a clean Linux clone, two of 38 static gates and 22 of 1,626 root security tests failed, 108 of 168 API suites died without PostgreSQL 18 binaries, and roughly 1,750 tests were not wired into CI at all.
  • How it was noticed: The independent review in docs/INDEPENDENT-REVIEW-2026-12-02.md cloned the repository cleanly on Linux and ran every check before changing a line.
  • Cause in plain words: "Verified" meant verified on one authoring Windows machine; one gate hashed Windows CRLF bytes, another followed links outside the repository, and growth-only gates rewarded adding files while CI had never run.
  • Fix: Wave 45 E built the shared manifest (tools/gates.manifest.json) and bash tools/verify, pinned LF in .gitattributes and recorded the correction openly in LOG.md. Wave 46 D enabled CI on push (OD-17) and retired 141 growth-only count assertions (OD-18).
  • General lesson: A big check count is not proof; a result only counts as verified when a clean clone can reproduce it from one documented command.

The import dropped in a clean Git merge

  • What happened: After merging Wave 48 workstream B (Meta budget executor) and workstream A (dispatch process), apps/api/src/server.ts called new KekKeyring(...) while its import line only imported zeroizeBuffer from @{product}/vault.
  • How it was noticed: Immediately after the merge (fixed two minutes later in commit 957bb99).
  • Cause in plain words: Workstream A moved token refresh out of server.ts and removed the now-unused KekKeyring import; workstream B left the import untouched and added a new KekKeyring call for budget execution. Git merged both branches with zero conflicts by taking A's shorter import line and B's new call.
  • Fix: Restored KekKeyring to the import line in server.ts and re-ran typecheck and tests.
  • General lesson: Zero merge conflicts means the text lines did not collide—not that the combined program compiles. Always run pnpm typecheck and tests after every merge.

The test that pointed at the owners' live Windows database folder

  • What happened: A Wave 45 test for the dev-stack launcher set TMPDIR to isolate its temporary PostgreSQL folder. On Windows, Node's os.tmpdir() ignores TMPDIR and reads TEMP and TMP, so the test resolved its data directory straight to the owners' live development cluster folder and attempted pg_ctl start against it. Because that cluster was already running, the start failed without changing or stopping anything.
  • How it was noticed: Three Wave 46 agents hit six failing tests on Windows; one agent verified read-only (PID file, port, server log) that the owners' server was untouched, and agent E isolated the cause with a one-line os.tmpdir() check (docs/wave46/reports/E-REPORT.md).
  • Cause in plain words: A Linux-only isolation variable (TMPDIR) silently did nothing on Windows.
  • Fix: The test now sets TEMP, TMP and TMPDIR and asserts before touching disk that os.tmpdir() points inside its disposable directory; browser journeys also explicitly refuse ports 3000, 4000, 5432 and any live dev-cluster path.
  • General lesson: Tests must prove they are isolated before acting, and when anything unexpected points near real data, stop retrying and verify read-only first.

Duplicate PostgreSQL helpers and flaky wall-clock ceilings

  • What happened: Two hidden test-infrastructure faults built up across earlier waves. First, 184 test files carried 20 slightly different copy-pasted PostgreSQL discovery snippets; 14 of them silently accepted PostgreSQL 17 instead of PostgreSQL 18. Second, 214 timing assertions checked hard millisecond ceilings (such as under 250 ms), failing under CPU contention on CI while letting two real quadratic regular expressions hide on a fast laptop.
  • How it was noticed: The independent review flagged duplicated helpers and timing flakes; Wave 46 D and Wave 48 D audited every call site (docs/wave46/reports/D-REPORT.md, docs/wave48/reports/D-REPORT.md).
  • Cause in plain words: Test helpers were copy-pasted instead of shared, and wall-clock time measured machine speed instead of algorithmic growth.
  • Fix: Wave 48 D replaced 181 private helpers with one import of tools/lib/pg-local.mjs (plus tools/check-pg-discovery-single-helper.mjs so duplicates cannot return). Wave 46 D replaced 214 wall-clock budgets with tools/lib/linear-time.mjs, which immediately exposed and drove fixes for two real quadratic regex defects.
  • General lesson: Test the real property you care about (server version 18, linear scaling), share one helper and add a gate so copy-paste drift cannot return.

Try it yourself

All four commands below are read-only and safe on Windows. None start servers, none touch ports 3000, 4000 or 5432, and none modify tracked files.

Step 1: read recent commits and see the exact hashes in PowerShell

git log --oneline -n 8

You should see eight short lines, each starting with a seven-character commit hash followed by its scoped commit message. Notice how every verification receipt cites that exact short hash.

Step 2: print the full verification manifest plan in Git Bash

bash tools/verify --list

Git Bash lists all 70 verification steps grouped into core, static, suites, postgres, deploy, scanners, build and browser, showing each step's exact command and prerequisites (needs) without executing any of them.

Step 3: verify that local verify and GitHub Actions CI match 1:1 in PowerShell

node tools/check-gate-parity.mjs

You should see a clean passing summary confirming that every entry in tools/gates.manifest.json matches .github/workflows/verify.yml in both directions.

Step 4: run the learning drift gate on this very lesson in PowerShell

node tools/learning/build.mjs --check-file docs/lessons/02-how-we-build.md

The command validates this file's front matter, section order, links, exact-case repository paths, tone rules and dictionary sync, printing PASS when every rule holds.

Words to know

  • agent report
  • branch
  • brief (workstream)
  • browser journey
  • CI workflow
  • code review
  • coding agent
  • commit
  • continuous integration
  • depth-first
  • drift gate
  • failing test first
  • Git
  • .gitattributes
  • GitHub Actions
  • green build
  • independent review
  • integrator
  • line ending
  • lockfile
  • merge
  • merge conflict
  • negative control
  • not run
  • project log
  • pull request
  • real-database test
  • receipt (evidence)
  • self-test
  • stacked pull request
  • typecheck
  • unit test
  • wave
  • wiring (workstream)
  • workstream
  • worktree

Go deeper

  • Verification contract, manifest and wave history: docs/VERIFICATION.md, tools/gates.manifest.json, .github/workflows/verify.yml, LOG.md and docs/INDEPENDENT-REVIEW-2026-12-02.md.
  • Wave briefs and reports: docs/wave46/README.md, docs/wave47/README.md, docs/wave48/README.md, docs/wave49/README.md and docs/wave49/briefs/COMMON.md.
  • Lesson authoring and drift gate rules: AUTHORING.md and tools/learning/build.mjs.
  • Archived lessons this lesson replaces (historical only, not a source of current facts): archived lesson 11, archived lesson 13, archived lesson 16, archived lesson 17, archived lesson 23 and the archive index.
  • Official external documentation: Git documentation, git-worktree reference, GitHub Actions documentation, Vitest documentation, Playwright documentation and pnpm documentation.

Kendini sına soru özeti ve yanıt anahtarı

Q1. Two branches merge cleanly with zero Git merge conflicts. Why must you still run typecheck and tests before trusting the merge?

Answer: B

A conflict-free merge only proves the two branches touched different lines; it says nothing about whether the resulting program compiles or satisfies business rules. That exact failure occurred in Wave 48 (957bb99) when branch A removed a KekKeyring import that branch B had just started using. Option A is false—Git merges deterministically according to the merge base.

Q2. A developer reports "All checks green locally" after running bash tools/verify, and the summary shows 65 passed, 0 failed, 5 not run (pg18 missing). How should you read that report?

Answer: B

Zero failures with five not run steps means those five database suites never executed, so their guarantees remain unproven on that machine. Option A is the tempting mistake that docs/VERIFICATION.md rule 1.1 exists to stop: not run is never equivalent to passed.

Q3. Which test layer catches a missing CORS header that stops the browser from sending a custom request header on a POST request?

Answer: C

Only a real browser executes CORS preflight checks and enforces browser cookie and header rules. Option B is the tempting wrong answer because app.inject() tests the API route directly inside Node without a browser, which is exactly why Wave 46 F's Chromium journey caught the CORS gap after unit and API suites had already passed.

Q4. Why did Wave 46 replace 214 absolute millisecond ceilings (such as "under 250 ms") with growth-ratio checks in tools/lib/linear-time.mjs?

Answer: B

Wall-clock budgets flaked constantly under load on two-core machines yet failed to catch two real quadratic regexes on a fast workstation. Comparing 1/8-size and full-size interleaved medians tests algorithmic scaling directly. Option C is wrong because linear-time.mjs fails loudly when work grows 24x or more and verifies itself with a cubic negative control.

Q5. Why did the founders retire 141 growth-only minimum-count assertions under owner decision OD-18?

Answer: B

Asserting that route, document or UI counts can only go up made adding files the easiest way to stay green and blocked healthy simplification. Replacing counts with behavioral invariants lets the team delete redundant code while keeping every safety rule enforced. Option A is wrong because verification grew deeper—adding real-browser journeys and PostgreSQL 18 checks—not weaker.

Q6. A bug is reported in an approval ceiling check. What is the safest order of steps when fixing it?

Answer: B

Writing the failing test first proves that the test actually reproduces the defect and will catch any future regression, while running typecheck and gates before opening a pull request ensures the fix integrates cleanly. Option A is the dangerous shortcut forbidden by COMMON.md, and Option D (--list) executes zero checks.

GetClaps Kurucu Akademisi · Tarayıcı açılışında ağ çağrısı yapılmaz; ilerleme yalnızca cihazındaki yerel depolamada tutulur.