Skip to content

Commit d69b4bb

Browse files
committed
Update 3tk examples
1 parent 377fe19 commit d69b4bb

5 files changed

Lines changed: 228 additions & 2 deletions

File tree

design/STATUS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ instruction, read this file and ask what to work on.
3939
## Rules
4040
- Read STATUS.md in full each session. It says where we are and what is next.
4141
- Session Log lives in STATUS-LOG.md (append-only, newest entries at top). Do NOT read it by default — append new entries there without reading the rest. Read STATUS-LOG.md only when explicitly asked (history audit, "what did we do about X", resolving a specific past-decision question).
42-
- No git directly. Owner does git.
42+
- No git directly, in this or any other repo. Owner does git. Exception: plain `git status` may be run without asking; every other git command still needs the owner or explicit one-off approval.
4343
- No skipping stages. Each stage passes before the next.
4444
- No real code before infrastructure (Stage 0) is verified.
4545
- Show intent before code changes. Get owner approval.
@@ -53,7 +53,7 @@ instruction, read this file and ask what to work on.
5353
- Status file ownership. A fact lives in exactly one file; the others get a pointer, not a copy. STATUS.md = current state only, no stage narrative. Plan = forward-looking work + one line per completed stage. STATUS-LOG.md = the narrative. context.md = one short line per doc, saying what it is. Full entry in rules-049.md.
5454

5555
## Constraints for Next Agent (MUST)
56-
- Git disabled. Do NOT run any git commands.
56+
- Git disabled, in every repo, always. Do NOT run any git commands except plain `git status`, which is allowed on its own.
5757
- Coding style: LE imports, explicit types, explicit dereference, stdlib first, errdefer/defer for resource cleanup.
5858
- Doc style: short sentences, bullets, no AI-sh words. See plan Section 1.
5959
- Run verification via kitchen scripts, not manual zig commands.

design/secondary/lang/c3/3tk-log.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,83 @@ Current state is in [3tk-status.md](3tk-status.md).
77

88
---
99

10+
## 2026-08-31 — 3TK-57 follow-up: docs.yml now deploys to Pages
11+
12+
**The Pages-collision question 3TK-57 left open is resolved — not by a
13+
ruling, but by the repo split itself.** The blocker was: *"this repo's Pages
14+
deployment already belongs to ztk's `docs.yml`. A second workflow calling
15+
`deploy-pages` without coordination would clobber it."* That was true only
16+
while both workflows lived in `matryoshka-tk`. Once 3tk's CI moved to its own
17+
repo, `matryoshka-3tk`, there is no second workflow in the same repo to
18+
clobber — ztk's Pages deployment is in a different repo entirely.
19+
20+
**`matryoshka-3tk/.github/workflows/docs.yml` gained a `deploy` job**, added
21+
after the owner reviewed external advice (correct in shape, but guessed at
22+
`c3c docgen`'s output rather than checking it):
23+
24+
- `docgen` job unchanged through the `c3c docgen --emit-stdlib=no src
25+
examples` step, still no mkdocs and no `kitchen/tools/*.sh` equivalent —
26+
plan 021 was explicit that there is nothing for the docs workflow to wrap
27+
beyond that one command.
28+
- A new "Prepare Pages site" step: `mkdir site && cp docs.html
29+
site/index.html`. `c3c docgen` writes one self-contained `docs.html` into
30+
the current directory — `preview-docs.sh`'s own comment says so — not a
31+
directory, so `actions/upload-pages-artifact@v3` (which needs a directory
32+
with `index.html` at its root) can't point at `docs.html` directly.
33+
- `actions/upload-pages-artifact@v3` replaces the plain `actions/upload-artifact@v4`
34+
step; a separate `deploy` job (`needs: docgen`, `permissions: {pages:
35+
write, id-token: write}`, `environment: github-pages`) calls
36+
`actions/deploy-pages@v4`.
37+
38+
**Still the owner's step, not run here:** enabling Pages on `matryoshka-3tk`
39+
(Settings → Pages → Source: GitHub Actions) before the workflow's `deploy`
40+
job can succeed.
41+
42+
## 2026-08-31 — 3TK-57: GitHub Actions CI, built in `matryoshka-3tk`
43+
44+
Plan 021 declared `.github/workflows/3tk-linux.yml`, `3tk-sanitizers.yml`,
45+
`3tk-docs.yml` and README badges here, in `matryoshka-tk`, scoped with
46+
`paths:`/`working-directory` to `design/secondary/lang/c3/3tk/**` — the same
47+
pattern ztk's own workflows use in this repo.
48+
49+
**The owner corrected that placement mid-stage: every 3tk workflow belongs in
50+
`matryoshka-3tk` (local path `~/dev/root/github.com/g41797/matryoshka-3tk`),
51+
not here.** That repo is 3tk's own tree — `src/`, `test/`, `negative/`,
52+
`examples/`, `project.json` and `scripts/{run-builds,run-sanitizers,preview-docs}.sh`
53+
all live at its root, mirroring how ztk's repo owns its own `.github/`. The
54+
first draft, written directly into `matryoshka-tk/.github/workflows/`, was
55+
removed and rewritten there instead.
56+
57+
**Written, in `matryoshka-3tk`:**
58+
59+
- `.github/workflows/linux.yml` — push/pull_request/workflow_dispatch,
60+
`c3c build mtk` + `c3c test`, matrix `safe:[yes,no] × opt:[O0,O3]`, matching
61+
`scripts/run-builds.sh`'s four `MODES`. No `paths:` or
62+
`working-directory` needed — the whole repo is 3tk.
63+
- `.github/workflows/sanitizers.yml``workflow_dispatch` only, installs
64+
clang via `apt-get`, then `c3c test --sanitize=<thread|address> --cc clang`
65+
for the same three combinations `scripts/run-sanitizers.sh` runs (`thread
66+
safe-O0`, `thread fast-O3`, `address safe-O0`), 15-minute timeout per job.
67+
- `.github/workflows/docs.yml` — push to `main` on `src/**`/`examples/**`
68+
plus `workflow_dispatch`; `c3c docgen --emit-stdlib=no src examples`,
69+
uploaded as a build artifact, not deployed to Pages (the open
70+
coexistence question with ztk's Pages deployment is unchanged by this).
71+
- Three README badges added to `matryoshka-3tk/README.md`, which had none
72+
before.
73+
74+
**Installing c3c**, same in every workflow, verified against the live GitHub
75+
API for `v0.8.3` before being written rather than assumed: the Linux asset is
76+
`c3-linux.tar.gz`, confirmed to extract to `c3/` containing `c3/c3c` — fetched
77+
and inspected with `curl`/`tar tzf`, not recalled from memory.
78+
79+
**No stage ran `git`.** All six files (three workflows, one README edit) were
80+
written directly; nothing was staged, committed, or pushed in either repo. The
81+
owner saves and pushes both.
82+
83+
**A memory record was added** (`3tk-ci-lives-in-matryoshka-3tk` in Claude's
84+
memory) so a future 3tk CI/workflow task starts from the corrected repo
85+
without repeating this correction.
86+
1087
## 2026-08-31 — 3TK-50 step 9: Shutdown, entries 46–48
1188

1289
**Catalog section "Shutdown."** One of the three entries carries a code
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
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.

design/secondary/lang/c3/3tk-status.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,7 @@ not the record.
515515
| **3TK-52** | the shared clause: closed and quiet, and specification 005 | 2026-08-28 |
516516
| **3TK-55** | the defect list catches up with the code | 2026-08-28 |
517517
| **3TK-56** | the close hook takes the queue by value, and `P6` is closed | 2026-08-30 |
518+
| **3TK-57** | GitHub Actions CI — built in `matryoshka-3tk`, not here | 2026-08-31 |
518519

519520
**3TK-50 is missing from the list because it has not run** — it is plan 019's
520521
leftover and is in the table above.
File renamed without changes.

0 commit comments

Comments
 (0)