Skip to content

Migrate curriculum rig import to city.toml [[rigs]] (gc 1.2.1)#85

Draft
austinborn wants to merge 2 commits into
mainfrom
migrate-curriculum-rig-import-to-city-toml
Draft

Migrate curriculum rig import to city.toml [[rigs]] (gc 1.2.1)#85
austinborn wants to merge 2 commits into
mainfrom
migrate-curriculum-rig-import-to-city-toml

Conversation

@austinborn

Copy link
Copy Markdown
Collaborator

Summary

gc 1.2.1 rejects [defaults.rig.imports.factory] in pack.toml. This migrates the Software Factory Intensive curriculum's active-lesson selection to the gc 1.2.1 shape (a [[rigs]] block carrying [rigs.imports.factory] in city.toml) as one coordinated change, so the curriculum's own linter, snapshots, walkthroughs, templates, and docs all move together. A partial migration breaks the repo's own checks, because the linter previously required the old pattern.

What changed

  • test-harness/lesson-pack-lint.py: dropped the SFI112 rule that required the legacy pack.toml block. Added SFI104 (city config must select a lesson through a [[rigs]] factory import) and SFI114 (flags the legacy pack.toml block if it lingers). Re-pointed the SFI501/SFI502 doc checks at the [[rigs]] shape and fixed the SFI103 hint.
  • my-factory/{pack,city}.toml.template: moved the factory import out of pack.toml and into the city.toml [[rigs]] block.
  • test-harness/walkthrough-snapshots/L1/pack.toml: dropped the legacy block (the matching city.toml snapshot was already on the new shape).
  • test-harness/walkthroughs/{L1,L2,L3,L4,C1}.sh: the generated city.toml now carries the [[rigs]] block, and the imperative gc --rig rig import add/remove factory step is replaced by a check that the import is declared in city.toml.
  • Docs (~20) — the top-level README, my-factory/README.md, the activities/ and curriculum/ lab and capstone READMEs and PROMPTs, and the fired-up-pizza reference now teach editing city.toml instead of running gc --rig <rig> import.

How to verify

Run from the repo root:

python3 test-harness/lesson-pack-lint.py --lesson L2 --lesson L3 --lesson L4 --lesson C1
bash test-harness/migration-check.sh

The linter reports only the two pre-existing SFI100/SFI110 findings, which fire because the gitignored my-factory/{city,pack}.toml runtime copies do not exist on a fresh checkout. That matches the linter's behavior before this change. Copy the templates to real files (cp my-factory/pack.toml.template my-factory/pack.toml, same for city.toml) and the linter is fully clean, with zero findings. migration-check.sh passes every structural invariant.

Not verified: gc 1.2.1 runtime

Only gc 1.1.1 was available in the build environment, and 1.1.1 does not understand the [[rigs]] city.toml shape, so the walkthrough scripts' live gc register and gc rig add behavior under gc 1.2.1 was not exercised. The gc-independent checks above all pass. Confirm the walkthroughs against a real gc 1.2.1 before relying on them.

Open question for review

The [[rigs]] block declares a rig name, while gc rig add <dir> derives the rig name from the directory's basename. The generic templates and curriculum use name = "rig" (matching the committed L1/city.toml snapshot and the walkthrough's rig/ directory); the fired-up-pizza reference uses name = "fired-up-pizza". Whether the [[rigs]] name must match the gc rig add basename, and whether [[rigs]] needs a dir field pointing at the project, both need confirmation on gc 1.2.1.

Test plan

  • lesson-pack-lint.py --lesson L2..C1 is clean except the pre-existing SFI100/SFI110
  • migration-check.sh passes
  • On gc 1.2.1, a walkthrough (e.g. test-harness/walkthroughs/L2.sh) registers the city and resolves the factory import from city.toml

Generated by the operator's software factory.
• City: factory-main · Agent: local-core.builder-2
• On behalf of: @austinborn

austinborn and others added 2 commits June 6, 2026 19:12
gc 1.2.1 rejects [defaults.rig.imports.factory] in pack.toml. Move the
active-lesson selection to the city.toml [[rigs]] block (the gc 1.2.1
target shape) as one coordinated change, so the curriculum's own linter,
snapshots, walkthroughs, templates, and docs all move together. A partial
migration breaks the repo's own checks, because the linter previously
required the old pattern.

- lesson-pack-lint.py: drop the SFI112 requirement for the legacy
  pack.toml block; add SFI104 (city.toml must select a lesson via a
  [[rigs]] factory import) and SFI114 (flag the legacy pack.toml block);
  re-point the SFI501/SFI502 doc checks at the city.toml [[rigs]] shape;
  fix the SFI103 hint.
- my-factory/{pack,city}.toml.template: move the factory import into the
  city.toml [[rigs]] block.
- walkthrough-snapshots/L1/pack.toml: drop the legacy block.
- test-harness/walkthroughs/{L1,L2,L3,L4,C1}.sh: write/select the lesson
  via city.toml [[rigs]]; replace the imperative gc rig import flow with a
  declarative-config check.
- ~20 lab/capstone docs and READMEs: teach the city.toml [[rigs]]
  selection instead of the old pack.toml block and gc --rig import flow.

Verified: lesson-pack-lint.py (L2..C1) and migration-check.sh pass; with
the templates copied to my-factory/{city,pack}.toml the lint is fully
clean. Not verified end-to-end against gc 1.2.1 (only 1.1.1 was available).

Generated by the operator's software factory.
City: factory-main · Agent: local-core.builder-2
On behalf of: @austinborn
Co-Authored-By: operator-factory-bot <factory-bot@operator-domain.invalid>
The new city.toml [[rigs]] block is rig-specific: name must match the rig gc
resolves, unlike the old rig-agnostic [defaults.rig.imports.factory] pattern.
The migration left name = "rig" hardcoded in the student-facing docs and the
template with no instruction to change it. A student whose rig is named after
their project basename would end up with an import that never binds to their
actual rig; the walkthroughs masked this because their scratch rig is literally
named "rig".

Changes:
- 16 student-facing docs (19 [[rigs]] blocks): name = "rig" -> name = "<rig>"
  with an inline note pointing at `gc rig list`, matching the <rig> placeholder
  already used for the sling targets and the reference-project exemplar.
- curriculum/labs/L2/README.md: fix the matching "the rig named rig" prose.
- my-factory/city.toml.template: keep name = "rig" as the working default (the
  walkthrough harness copies it verbatim and binds it to a scratch rig named
  "rig") and add a comment telling students to set name to their own rig.

Left unchanged: the reference-project/fired-up-pizza exemplar (already correct),
the test-harness walkthrough scripts, and the L1 city.toml snapshot (their rig
is genuinely "rig").

Verified: lesson-pack-lint.py (L2..C1) = 0 errors and migration-check.sh = all
invariants pass, with templates copied to my-factory/{city,pack}.toml. Not
verified end-to-end against gc 1.2.1 (only 1.1.1 available).

Generated by the operator's software factory.
City: factory-main · Agent: local-core.builder-1
On behalf of: @austinborn
Co-Authored-By: operator-factory-bot <factory-bot@operator-domain.invalid>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant