Repository navigation
t27o dogfooding: clean our own target repos of hand-written foreign code, to a high quality standard #9000
Copy link
Copy link
Open
Labels
Description
Part of epic #8998. Owner, 2026-10-11 (translated): "we need dogfooding with all our target repositories, so we can clean them of other hand-written code and bring them to a high quality standard."
Baseline (GitHub linguist, 2026-10-11)
Linguist does not know .t27 and counts generated code. Most of t27's Zig is gen/ output, and ghashtag.github.io is mostly the built site. So step 1 replaces this table with hand-written lines only.
| repo | size | languages |
|---|---|---|
| t27 | 40.8 MB | Zig 48%, Rust 25%, Python 16%, Lean 4%, Verilog 2% |
| trinity | 109.6 MB | Zig 52%, HTML 17%, TypeScript 8%, C 6%, JavaScript 4%, Verilog 4% |
| trios | 17.6 MB | Zig 42%, Rust 37%, Swift 17%, Rocq 2%, TypeScript 2% |
| BrowserOS | 5.2 MB | TypeScript 69%, C++ 17%, Go 10% |
| 999-multibots-telegraf | 42.4 MB | TypeScript 78%, JavaScript 9%, Shell 3% |
| ghashtag.github.io | 39.1 MB | JavaScript 56%, HTML 42% |
Steps, per repo
- Measure the real debt. Count hand-written foreign lines by language, excluding generated paths (gen/, built site output, vendored deps), with the own-language classification (specs/policy/own_language.t27). Publish one table per repo, and re-measure it weekly.
- Install the quality gates. These follow the pattern used for the gitleaks gate in 20 repos (see security: lefthook + gitleaks secret gate (pre-commit, pre-push, CI); remove OSF token #6433):
- the own-language shrink-only gate (check_budget: foreign lines never grow, policy: hand-written code in any language but t27 may only shrink (Closes #8227) #8236);
- the DRY ratchet (duplicate bodies only go down, AGENTS.md and the t27b-loop skill: DRY -- never add a spec or function that already exists #8963);
- secrets scanning.
- Scan with t27o. For each repo, report the share of functions t27o can convert and the share it verifies against the oracle, with refusal reasons.
- Golden PRs. Verified functions become .t27 specs with oracle tests; the foreign code is deleted, or reused through
useper DRY. Every PR is net-negative in foreign lines. - Badge and trend. Show golden coverage % and foreign lines over time in each README.
Order, by front-end readiness
- Rust (t27 25%, trios 37%): t27o works today (t27o (Ouroboros): Rust front end MVP -- skeleton, normalisation and a rustc oracle, written in t27 (Closes #8966) #8970). Start here.
- Zig (t27, trinity, trios; the largest share): after t27o: Zig front end, with a round-trip check over our own corpus via gen-zig #8994, with the round-trip check.
- Python (t27 16%): after t27o: Python front end, with types inferred from oracle traces #8995.
- TypeScript (BrowserOS, 999-multibots, trinity): needs a TS front end, to be filed after Zig and Python.
- Swift (trios apps), C++/Go (BrowserOS), HTML/CSS: UI, platform and browser code that t27 does not express today. These stay out of scope, and the report says so per path.
Done when
Every target repo has the gates installed and a published debt table. Each convertible language has at least one landed golden PR per repo. The foreign-line trend is falling week over week.
User Scenarios
- Given the t27 compiler and target repositories contain hand-written foreign code, when the quality gates (own-language shrink-only, DRY ratchet, secrets scanning) are installed in each target repo, then foreign line counts never increase and duplicate bodies only decrease.
- Given t27o can convert and verify functions in Rust today, when golden PRs are created for verified functions in the Rust codebases (t27, trios), then each PR is net-negative in foreign lines and the foreign-line trend falls week over week.
- Given the own-language classification spec exists, when hand-written foreign lines are measured excluding generated paths (gen/, built site output, vendored deps), then a published debt table per repo shows only hand-written lines by language.
Requirements
- FR-001: The own-language shrink-only gate (check_budget) MUST be installed in every target repository so foreign lines never grow.
- FR-002: The DRY ratchet gate MUST be installed in every target repository so duplicate bodies only go down.
- FR-003: Secrets scanning MUST be installed in every target repository following the gitleaks pattern from security: lefthook + gitleaks secret gate (pre-commit, pre-push, CI); remove OSF token #6433.
- FR-004: A hand-written foreign line debt table MUST be published per target repo using specs/policy/own_language.t27 classification, excluding generated paths, and re-measured weekly.
- FR-005: t27o MUST scan each repo and report the share of functions convertible and verifiable against the oracle, with refusal reasons.
- FR-006: For each convertible language (starting with Rust), at least one golden PR MUST land per target repo, converting verified functions to .t27 specs with oracle tests and deleting or reusing foreign code via
use. - FR-007: Each golden PR MUST be net-negative in foreign lines.
- FR-008: Golden coverage percentage and foreign lines over time MUST be displayed in each target repo's README as a badge and trend.
Boundary
- specs/policy/own_language.t27
Reactions are currently unavailable
Activity