|
| 1 | +# 3tk — staging plan 021 |
| 2 | + |
| 3 | +Written 2026-08-31. |
| 4 | + |
| 5 | +**Provenance.** Follows [3tk-staging-plan-020.md](backup/3tk-staging-plan-020.md). 020 |
| 6 | +carried **3TK-50** forward unchanged and declared **3TK-51 to 3TK-55**. All of |
| 7 | +that has since run — 3TK-50 closed across eleven steps (`3tk-log.md`, 2026-08-31), |
| 8 | +3TK-51 through 3TK-55 all ran 2026-08-28, and **3TK-56 also ran** (2026-08-30, |
| 9 | +closing `P6`) without a separate declaration, since it fell directly out of |
| 10 | +3TK-54's own measurement. **020 is fully spent.** This plan declares one stage: |
| 11 | +**3TK-57.** |
| 12 | + |
| 13 | +State is in [3tk-status.md](3tk-status.md). Narrative is in |
| 14 | +[3tk-log.md](3tk-log.md). Neither is duplicated here. |
| 15 | + |
| 16 | +--- |
| 17 | + |
| 18 | +## Why this plan exists |
| 19 | + |
| 20 | +**Everything 3tk builds and tests locally — `run-builds.sh`'s four modes, |
| 21 | +`run-sanitizers.sh`'s three sanitizer runs — has no automated check on a push |
| 22 | +or a pull request.** The owner asked for GitHub Actions workflows, patterned on |
| 23 | +the ones already in this repo for ztk (`.github/workflows/linux.yml`, |
| 24 | +`mac.yml`, `windows.yml`, `docs.yml`), but adapted: c3c has no `setup-c3` |
| 25 | +action the way Zig has `mlugg/setup-zig`, 3tk's toolchain is measured only on |
| 26 | +linux-x64, and the owner does not want CI invoking `run-builds.sh` or |
| 27 | +`run-sanitizers.sh` as scripts — the workflows replicate their underlying |
| 28 | +commands directly as steps, the same way ztk's workflows call `zig build test` |
| 29 | +directly rather than through a wrapper. |
| 30 | + |
| 31 | +**Four decisions the owner made, binding on 3TK-57:** |
| 32 | + |
| 33 | +1. **Linux only.** No macOS/Windows legs — the port calls pthread directly and |
| 34 | + has never been tried on either. |
| 35 | +2. **Sanitizers in their own file, manually triggered** (`workflow_dispatch` |
| 36 | + only, never push/PR), installing their own compiler (clang) rather than |
| 37 | + assuming the runner has it. |
| 38 | +3. **Negatives, tier-1 aborts and nocompile checks stay local-only.** CI runs |
| 39 | + build+test per mode; `run-builds.sh` remains the full local gate. |
| 40 | +4. **The docs workflow does only the `c3c docgen` flow** — no mkdocs, no |
| 41 | + `kitchen/tools/*.sh` equivalent. `c3c docgen` already produces a complete, |
| 42 | + self-contained doc site; there is nothing for it to wrap. |
| 43 | + |
| 44 | +**One call flagged for the owner to override, not yet resolved:** this repo's |
| 45 | +Pages deployment already belongs to ztk's `docs.yml`. A second workflow |
| 46 | +calling `deploy-pages` without coordination would clobber it. **3TK-57's docs |
| 47 | +workflow builds and uploads the `c3c docgen` output as a workflow artifact |
| 48 | +only — it does not deploy to Pages** until the owner decides how the two doc |
| 49 | +sets should coexist on one site. |
| 50 | + |
| 51 | +## The stage |
| 52 | + |
| 53 | +``` |
| 54 | +3TK-57 GitHub Actions CI for 3tk .github/workflows/ + README.md |
| 55 | +``` |
| 56 | + |
| 57 | +**Why one stage and not several.** Unlike 3TK-51–55, nothing here is staged on |
| 58 | +an unresolved design question — the four decisions above are already made, and |
| 59 | +the three workflow files have no dependency order between them. Splitting them |
| 60 | +into separate stages would only fragment one afternoon's work across several |
| 61 | +clear points for no reason the *Five stages means five clear points* logic in |
| 62 | +020 actually needed. |
| 63 | + |
| 64 | +--- |
| 65 | + |
| 66 | +## 3TK-57 — GitHub Actions CI for 3tk |
| 67 | + |
| 68 | +**Output: three new workflow files, plus three README badges.** |
| 69 | + |
| 70 | +| file | trigger | what it does | |
| 71 | +|---|---|---| |
| 72 | +| `.github/workflows/3tk-linux.yml` | push, pull_request, workflow_dispatch; `paths: design/secondary/lang/c3/3tk/**` | `c3c build mtk` + `c3c test`, matrix `safe:[yes,no] × opt:[O0,O3]` — the same four combinations as `run-builds.sh`'s `MODES` | |
| 73 | +| `.github/workflows/3tk-sanitizers.yml` | workflow_dispatch only | installs clang, then `c3c test --sanitize=<thread\|address> --cc clang` for the same three combinations `run-sanitizers.sh` runs (`thread safe-O0`, `thread fast-O3`, `address safe-O0`), 15-minute timeout per run | |
| 74 | +| `.github/workflows/3tk-docs.yml` | push to `main` with `paths` on `3tk/src/**` and `3tk/examples/**`, plus workflow_dispatch | `c3c docgen --emit-stdlib=no src examples`, uploaded as a build artifact — not deployed | |
| 75 | + |
| 76 | +**Installing c3c.** No `setup-c3` action exists. Confirmed against the GitHub |
| 77 | +API: `v0.8.3`'s Linux asset is `c3-linux.tar.gz`, which extracts to `c3/` |
| 78 | +containing `c3/c3c` and a bundled `c3/lib/std/` — self-contained, matching the |
| 79 | +version 3tk's own capability answers are measured against |
| 80 | +(`3tk-status.md`: "c3c 0.8.3, LLVM 22.1.8, linux-x64"). Every workflow installs |
| 81 | +it the same way: |
| 82 | + |
| 83 | +```yaml |
| 84 | +- name: Install c3c |
| 85 | + run: | |
| 86 | + curl -sL https://github.com/c3lang/c3c/releases/download/v0.8.3/c3-linux.tar.gz -o c3.tar.gz |
| 87 | + tar xzf c3.tar.gz |
| 88 | + echo "$PWD/c3" >> "$GITHUB_PATH" |
| 89 | +``` |
| 90 | +
|
| 91 | +**Every 3tk workflow scopes itself.** Unlike ztk's workflows, which own the |
| 92 | +whole repo, each 3tk file needs `paths:` (where it triggers on push/PR) and a |
| 93 | +job-level `working-directory: design/secondary/lang/c3/3tk`, since 3tk is one |
| 94 | +subtree in a multi-port repo. |
| 95 | + |
| 96 | +**README.md gains 3 more badges**, top of file alongside the existing 4, one |
| 97 | +per new workflow, same style: `.../actions/workflows/<file>.yml`. |
| 98 | + |
| 99 | +**Tests, and the stage does not close without them checked:** |
| 100 | + |
| 101 | +- Each new workflow file parses as valid YAML. |
| 102 | +- Every command in every workflow matches, field for field, what |
| 103 | + `run-builds.sh` / `run-sanitizers.sh` / `preview-docs.sh` actually run — |
| 104 | + checked against their source, not paraphrased. |
| 105 | +- The c3c download step is verified against the live GitHub API response for |
| 106 | + `v0.8.3` (asset name, extracted layout) before being written into the |
| 107 | + workflow files, not assumed. |
| 108 | + |
| 109 | +**What is not verified from here, and is the owner's step once pushed:** that |
| 110 | +the c3c download step actually succeeds on `ubuntu-latest`, and that |
| 111 | +`apt-get install clang` on `ubuntu-latest` pulls in whatever `libtsan`/`libasan` |
| 112 | +the sanitizer runs need — unlike this Fedora machine, which is missing them |
| 113 | +under its default `cc`. **No stage runs `git`.** The files are written; the |
| 114 | +owner pushes and watches the first run. |
| 115 | + |
| 116 | +--- |
| 117 | + |
| 118 | +## Rules that hold |
| 119 | + |
| 120 | +- **`run-builds.sh` stays green throughout** — nothing in 3TK-57 touches |
| 121 | + `3tk/src`, `test/`, `negative/` or `examples/`, so the counts do not move. |
| 122 | +- **No stage runs `git`.** Moves are plain `mv`. The owner saves and pushes. |
| 123 | +- **A claim about c3c is measured, never argued** — the download URL and |
| 124 | + tarball layout above were fetched and inspected, not assumed from memory. |
| 125 | +- **The Pages-collision question is written down, not guessed at.** 3TK-57 |
| 126 | + does not deploy to Pages; it stops at "build and upload as a workflow |
| 127 | + artifact" and leaves the coexistence question open. |
| 128 | + |
| 129 | +## Versioning |
| 130 | + |
| 131 | +**`3tk-staging-plan-020.md` is superseded by this file** and moves to |
| 132 | +`backup/`. Nothing else this stage produces is a versioned document — |
| 133 | +`.github/workflows/*.yml` and `README.md` are edited in place, same as any |
| 134 | +other source file a stage touches. |
| 135 | + |
| 136 | +## What this plan leaves to the owner |
| 137 | + |
| 138 | +- **The Pages-collision question.** A subpath, a merge step before one |
| 139 | + `deploy-pages` call, a separate deployment mechanism (e.g. |
| 140 | + `peaceiris/actions-gh-pages` targeting a subfolder of `gh-pages`) — or 3tk's |
| 141 | + docs staying artifact-only indefinitely. Not decided here. |
| 142 | +- **Whether macOS/Windows legs ever get added**, and who confirms the port |
| 143 | + actually builds there first. |
| 144 | +- **Whether sanitizers stay manual-only**, or graduate to a scheduled or |
| 145 | + push-triggered run once the workflow has been exercised a few times. |
| 146 | +- **The seven questions plan 018 left and 019 carried**, and everything in |
| 147 | + `3tk-status.md`'s *Open questions* — untouched by this stage, and not |
| 148 | + reopened by it. |
0 commit comments