Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions skills/aaif-create-chapter/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ Run these in order. Nothing is created without `--write`.
- [ ] **4. Verify** (below). A run is not finished until this passes.
- [ ] **5. Hand off.** Report the new folder URL. A new chapter is not on the
website until **`aaif-sync-chapters`** writes its feed row — that engine
also enforces the 100-chapter cap, which `create_chapter` only warns about.
also enforces the chapter cap, which `create_chapter` only warns about.

### Recovering a failed or partial run — `--resume`

Expand Down Expand Up @@ -222,9 +222,9 @@ template or the rebrand engine is broken. Fix that — don't resume.
python3 <skill-root>/scripts/render_web_banner.py --write
python3 <skill-root>/scripts/render_web_banner.py --chapter <City> --create --write
```
- **`create_chapter` writes no Chapters List row**, so its 100-chapter cap check
is an early warning, not a guarantee: three runs at 99 live chapters each read
99, each pass, and the next sync refuses all three rows together.
- **`create_chapter` writes no Chapters List row**, so its chapter cap check
is an early warning, not a guarantee: three runs one short of the cap each read
the same count, each pass, and the next sync refuses all three rows together.
- **The template must stay "clean"**: `San Francisco` contiguous (no run or
paragraph splits) and the slug normalized to `aaif-sanfrancisco`.
- **The map-marker fill is shared state.** `create_chapter.GREEN` is `--spec-3`
Expand Down
2 changes: 1 addition & 1 deletion skills/aaif-create-chapter/scripts/create_chapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"""
import argparse, fnmatch, html, json, math, os, re, shutil, sys, tempfile, time, unicodedata, urllib.error, urllib.parse, urllib.request, zipfile

# The 100-chapter cap is defined ONCE, in aaif-sync-chapters. A chapter comes
# The chapter cap is defined ONCE, in aaif-sync-chapters. A chapter comes
# into existence in two places — the Drive folder this script makes and the feed
# row that engine appends — and a second copy of the number here would let the
# two disagree, which means a half-made chapter whose other half is refused.
Expand Down
4 changes: 2 additions & 2 deletions skills/aaif-create-chapter/scripts/test_create_chapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -721,12 +721,12 @@ def test_resume_matches_original_name_subfolder_and_renames(self):

class TestMainGuards(unittest.TestCase):
"""Argument checks in main(), the plan-by-default / tempdir contract of a
--write run, and which invocations consult the 100-chapter cap."""
--write run, and which invocations consult the chapter cap."""

def run_main(self, argv, clone=None, cap_calls=None, banner=None):
"""Drive main() with every external call stubbed.

`assert_under_cap` joined that list when the 100-chapter cap landed: it
`assert_under_cap` joined that list when the chapter cap landed: it
reads the live chapters tab through the `gws` CLI, so leaving it real
made this suite hit the network on a developer machine and fail outright
on CI, where `gws` is not installed. `cap_calls` collects the `what`
Expand Down
16 changes: 8 additions & 8 deletions skills/aaif-sync-chapters/references/chapter-cap.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# The 100-chapter cap and the chapters-tab `Status` column
# The chapter cap and the chapters-tab `Status` column

> Load this when a new chapter row is refused, when deciding whether to retire a
> chapter, or before setting a `Status` value by hand. `chapter_health.py` is the
Expand Down Expand Up @@ -32,13 +32,13 @@ version.
Blank counting as live is deliberate: the alternative lets the estate grow past
the cap simply by nobody filling the column in.

`CHAPTER_CAP = 100` counts **rows on the chapters tab**, and the feed row is the
only thing that moves that count — so this engine's new-row path is the real
chokepoint. `create_chapter.py` checks the same cap before building a Drive
folder, but that check is an early warning, not a guarantee: creating a folder
adds no row, so three `create_chapter --write` runs at 99 live chapters each
read 99, each pass, and each build a folder, and the next sync refuses all three
rows together. Closing that properly means `create_chapter` claiming its row as
`CHAPTER_CAP` (100 from 2026-09-18, 125 since 2026-11-12) counts **rows on the
chapters tab**, and the feed row is the only thing that moves that count — so
this engine's new-row path is the real chokepoint. `create_chapter.py` checks
the same cap before building a Drive folder, but that check is an early warning,
not a guarantee: creating a folder adds no row, so three `create_chapter
--write` runs one short of the cap each read the same count, each pass, and each
build a folder, and the next sync refuses all three rows together. Closing that properly means `create_chapter` claiming its row as
it creates the folder, which it does not do yet. The number is defined once, in
`sync_chapters.py`, and `create_chapter.py` imports it; `census_of()` is the one
routine that decides which statuses count, for the same reason. Planning and report runs are exempt
Expand Down
2 changes: 1 addition & 1 deletion skills/aaif-sync-chapters/scripts/chapter_health.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
"""Rank chapters by whether anything is actually happening in them. READ-ONLY.

Exists because of the 100-chapter cap (see sync_chapters.CHAPTER_CAP): growth
Exists because of the chapter cap (see sync_chapters.CHAPTER_CAP): growth
has to be paid for by retiring or coalescing an existing chapter, and that is a
decision somebody has to make about a named chapter. This is the evidence for
that decision, and deliberately nothing more — it proposes a `Status` and never
Expand Down
10 changes: 6 additions & 4 deletions skills/aaif-sync-chapters/scripts/sync_chapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@
#: estate grow past the cap simply by nobody filling the column in.
RETIRED_STATUSES = ("Merged", "Deprecated")

#: Hard ceiling on live chapters (set 2026-09-18). The point is not the number:
#: Hard ceiling on live chapters (set at 100 on 2026-09-18, raised to 125 on
#: 2026-11-12 so Columbus and Philadelphia could launch without retiring a
#: chapter — an operator's call, made at the cap). The point is not the number:
#: it is that growth has to be paid for by sunsetting or coalescing something,
#: which is a decision somebody has to make rather than a queue that silently
#: grows.
Expand All @@ -104,12 +106,12 @@
#: create_chapter.py checks the same cap before building a Drive folder, but be
#: precise about what that check is worth: making a folder does not add a row,
#: so it cannot detect its own predecessors. Three `create_chapter --write` runs
#: at 99 live chapters each read 99, each pass, and each build a folder; the
#: next sync run then refuses all three rows at once. The folder check is an
#: one short of the cap each read the same count, each pass, and each build a
#: folder; the next sync run then refuses all three rows at once. The folder check is an
#: early warning that saves the common single-run case, NOT a guarantee — the
#: guarantee lives on the row. Closing that gap properly means create_chapter
#: claiming its row as it creates the folder, which it does not do yet.
CHAPTER_CAP = 100
CHAPTER_CAP = 125

# Also blank on new rows, but read-only legacy history — never backfilled, so the
# report must not tell an operator to fill it.
Expand Down
16 changes: 9 additions & 7 deletions skills/aaif-sync-chapters/scripts/test_chapter_cap.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
"""The 100-chapter cap and the Status census. Plain script; exit 1 on failure."""
"""The chapter cap and the Status census. Plain script; exit 1 on failure."""
import os
import sys

Expand Down Expand Up @@ -88,16 +88,18 @@ def census(pairs):
# --- `incoming` is a separate parameter, because it used to be smuggled ------
# The feed-row guard passed live+new as `live` and restated the breakdown inside
# `what`, so the headline printed "N live chapters" for a number that was not.
CAP = sc.CHAPTER_CAP
check("live + incoming under the cap is allowed",
sc.cap_refusal(98, {}, "append", incoming=2), None)
sc.cap_refusal(CAP - 2, {}, "append", incoming=2), None)
check("exactly at the cap with nothing incoming is allowed",
sc.cap_refusal(sc.CHAPTER_CAP, {}, "x", incoming=0), None)
over = sc.cap_refusal(98, {}, "append 3 new chapter row(s)", incoming=3)
sc.cap_refusal(CAP, {}, "x", incoming=0), None)
over = sc.cap_refusal(CAP - 2, {}, "append 3 new chapter row(s)", incoming=3)
check("live + incoming OVER the cap refuses", over.startswith("ABORT:"), True)
check("the headline separates live from incoming rather than summing silently",
"98 live chapters + 3 new = 101" in over, True)
"%d live chapters + 3 new = %d" % (CAP - 2, CAP + 1) in over, True)
check("a single-chapter refusal keeps the plain headline",
sc.cap_refusal(100, {}, "x").splitlines()[0].startswith("ABORT: 100 live chapters —"),
sc.cap_refusal(CAP, {}, "x").splitlines()[0].startswith(
"ABORT: %d live chapters —" % CAP),
True)

# --- an out-of-vocabulary Status counts as live AND is surfaced -------------
Expand All @@ -114,7 +116,7 @@ def census(pairs):
sc.unknown_statuses(by), [("merged", 3), ("Archived", 1)])
check("the vocabulary itself is not reported as unknown",
sc.unknown_statuses({"Active": 5, "Merged": 1, "": 3}), [])
odd = sc.cap_refusal(100, {"Archived": 2}, "x")
odd = sc.cap_refusal(CAP, {"Archived": 2}, "x")
check("the refusal warns about out-of-vocabulary values",
"not in the vocabulary" in odd and "'Archived' (2)" in odd, True)

Expand Down
Loading