feat(root03): author Git & Collaborative Development

Adds all 6 ROOT 03 modules (why version control exists, the Git mental model, everyday Git,
branching & merging, remote repositories, engineering Git workflow) — 31 activities. Uses only
real LOCAL Git repositories throughout — no Gitea account, no network access, and no
RootNode-canonical-repo credential is ever needed or exposed in a student Lab
(docs/ROOT_FOUNDATIONS_LAB_STRATEGY.md §4). Modules 1, 2, and 6 are conceptual bookends with no
lab, matching the flexible readiness standard already used in ROOT 01/02.

Adds 3 new hands-on Git scenarios plus 2 MCQs: git-everyday-basics (init/add/commit, validated
by inspecting real `git log`/`git show` state, not just command output strings — Step 6's
explicit requirement), git-branching-and-merge (a REAL merge conflict caused on purpose by two
branches editing the same line, resolved by the student, validated by confirming the conflict
markers are gone and a real two-parent merge commit exists), and git-remote-clone-push (a real
local bare repository standing in for a remote — clone/commit/push validated by inspecting the
REMOTE side directly, not just the student's own clone). All tested end-to-end via the real
scenario-validation API, including negative tests.

Wires rootnode-git-fundamentals-assessment (2 required + 3 random-draw scenarios) using the
existing Phase 3B assessment engine.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
2026-08-26 17:08:00 -05:00
co-authored by Claude Sonnet 5
parent e007bcf000
commit e68b6f445a
33 changed files with 1393 additions and 0 deletions
@@ -0,0 +1,123 @@
-- Phase 6E — ROOT 03: Git & Collaborative Development. Adds 6 modules/activities under the
-- existing (PLANNED, zero-content) root-03-git-collaborative-development course row. Every lab
-- activity uses real LOCAL git repositories (including a local bare repo standing in for a
-- remote) — no Gitea account, no network access, no RootNode-canonical-repo credential ever
-- reaches a student Lab (docs/ROOT_FOUNDATIONS_LAB_STRATEGY.md §4). Modules 1 and 6 are
-- conceptual bookends with no lab, matching the flexible readiness standard.
UPDATE courses SET
status = 'ready',
objectives = '{"Explain what version control gives you that copying files never could","Explain the working-tree/staging-area/repository model before memorizing commands","Use init/status/add/commit/log/diff fluently on a real repository","Create a branch, cause a real merge conflict, and resolve it deliberately","Clone, commit, and push to a real remote","Apply small-commit, reviewed, source-of-truth discipline"}',
updated_at = now()
WHERE course_id = 'root-03-git-collaborative-development';
INSERT INTO course_modules (module_id, course_id, title, description, sequence, objectives, prerequisites, estimated_duration_minutes, status) VALUES
('root-03-m01-why-version-control-exists', 'root-03-git-collaborative-development', 'Why Version Control Exists',
'History, reproducibility, collaboration, and rollback — the real problem Git solves, before any command. Target learner: has completed ROOT 02.',
1, '{"Explain what version control gives you that copying files does not","Explain why copying files as backup fails as a strategy"}', '{}', 20, 'ready'),
('root-03-m02-git-mental-model', 'root-03-git-collaborative-development', 'Git Mental Model',
'Working tree, staging area, repository — the model that makes every later command make sense. No lab — conceptual mastery via demonstrated reasoning.',
2, '{"Explain the working-tree/staging-area/repository model","Predict git status output from the model, not memorization"}', '{root-03-m01-why-version-control-exists}', 35, 'ready'),
('root-03-m03-everyday-git', 'root-03-git-collaborative-development', 'Everyday Git',
'init/status/add/commit/log/diff, against a real local repository.',
3, '{"Initialize and work in a real Git repository","Stage exactly the changes intended, verify with diff","Write a commit message that explains what and why"}', '{root-03-m02-git-mental-model}', 40, 'ready'),
('root-03-m04-branching-and-merging', 'root-03-git-collaborative-development', 'Branching & Merging',
'Real branches, a real merge conflict caused on purpose, and deliberate resolution.',
4, '{"Create and switch between branches","Explain why a merge conflict happens and that it is normal","Resolve a real merge conflict and complete the merge"}', '{root-03-m03-everyday-git}', 45, 'ready'),
('root-03-m05-remote-repositories', 'root-03-git-collaborative-development', 'Remote Repositories',
'Clone, fetch, pull, push against a real local-bare remote — no account or network required.',
5, '{"Clone a repository and explain origin","Distinguish fetch from pull and explain why pull can conflict","Push a real commit and verify it independently on the remote"}', '{root-03-m04-branching-and-merging}', 40, 'ready'),
('root-03-m06-engineering-git-workflow', 'root-03-git-collaborative-development', 'Engineering Git Workflow',
'Small commits, review, protecting main, and the direct bridge to CI/CD/GitOps/IaC. No lab — conceptual closer.',
6, '{"Explain why small, well-described commits matter beyond style","Explain why teams protect main and require review","Connect this course''s discipline to CI/CD and GitOps"}', '{root-03-m05-remote-repositories}', 30, 'ready')
ON CONFLICT (module_id) DO NOTHING;
INSERT INTO module_activities (activity_id, module_id, sequence, activity_type, title, content_path, scenario_id, assessment_definition_id, completion_behavior, estimated_duration_minutes, status) VALUES
-- M01 (no lab)
('root-03-m01-a01-lesson', 'root-03-m01-why-version-control-exists', 1, 'lesson', 'Why Version Control Exists',
'content/root/root-03-git-collaborative-development/m01-why-version-control-exists/01-lesson-why-version-control-exists.md', NULL, NULL, 'manual_marker', 10, 'ready'),
('root-03-m01-a02-knowledge-check', 'root-03-m01-why-version-control-exists', 2, 'knowledge_check', 'Knowledge Check: Why Version Control Exists',
'content/root/root-03-git-collaborative-development/m01-why-version-control-exists/02-knowledge-check.md', NULL, NULL, 'manual_marker', 4, 'ready'),
('root-03-m01-a03-reflection', 'root-03-m01-why-version-control-exists', 3, 'reflection', 'Reflection: Naming the Problem You''re About to Solve',
'content/root/root-03-git-collaborative-development/m01-why-version-control-exists/03-reflection.md', NULL, NULL, 'manual_marker', 6, 'ready'),
-- M02 (no lab)
('root-03-m02-a01-lesson', 'root-03-m02-git-mental-model', 1, 'lesson', 'Git Mental Model',
'content/root/root-03-git-collaborative-development/m02-git-mental-model/01-lesson-git-mental-model.md', NULL, NULL, 'manual_marker', 15, 'ready'),
('root-03-m02-a02-demonstration', 'root-03-m02-git-mental-model', 2, 'demonstration', 'Demonstration: Watching a File Move Between the Three Areas',
'content/root/root-03-git-collaborative-development/m02-git-mental-model/02-demonstration-watching-a-file-move-between-areas.md', NULL, NULL, 'manual_marker', 8, 'ready'),
('root-03-m02-a03-knowledge-check', 'root-03-m02-git-mental-model', 3, 'knowledge_check', 'Knowledge Check: Git Mental Model',
'content/root/root-03-git-collaborative-development/m02-git-mental-model/03-knowledge-check.md', NULL, NULL, 'manual_marker', 5, 'ready'),
('root-03-m02-a04-guided-exercise', 'root-03-m02-git-mental-model', 4, 'guided_exercise', 'Guided Exercise: Predict git status Before You See It',
'content/root/root-03-git-collaborative-development/m02-git-mental-model/04-guided-exercise-predicting-git-status.md', NULL, NULL, 'manual_marker', 10, 'ready'),
('root-03-m02-a05-reflection', 'root-03-m02-git-mental-model', 5, 'reflection', 'Reflection: The Model Explains the Commands, Not the Other Way Around',
'content/root/root-03-git-collaborative-development/m02-git-mental-model/05-reflection.md', NULL, NULL, 'manual_marker', 8, 'ready'),
-- M03
('root-03-m03-a01-lesson', 'root-03-m03-everyday-git', 1, 'lesson', 'Everyday Git',
'content/root/root-03-git-collaborative-development/m03-everyday-git/01-lesson-everyday-git.md', NULL, NULL, 'manual_marker', 15, 'ready'),
('root-03-m03-a02-demonstration', 'root-03-m03-everyday-git', 2, 'demonstration', 'Demonstration: The Full Cycle, End to End',
'content/root/root-03-git-collaborative-development/m03-everyday-git/02-demonstration-the-full-everyday-cycle.md', NULL, NULL, 'manual_marker', 8, 'ready'),
('root-03-m03-a03-knowledge-check', 'root-03-m03-everyday-git', 3, 'knowledge_check', 'Knowledge Check: Everyday Git',
'content/root/root-03-git-collaborative-development/m03-everyday-git/03-knowledge-check.md', NULL, NULL, 'manual_marker', 5, 'ready'),
('root-03-m03-a04-guided-exercise', 'root-03-m03-everyday-git', 4, 'guided_exercise', 'Guided Exercise: Plan a Real Commit Before You Make It',
'content/root/root-03-git-collaborative-development/m03-everyday-git/04-guided-exercise-planning-your-commit.md', NULL, NULL, 'manual_marker', 8, 'ready'),
('root-03-m03-a05-lab-everyday-basics', 'root-03-m03-everyday-git', 5, 'lab', 'Lab: Init, Track, Commit — Your First Real Repository',
NULL, 'git-everyday-basics', NULL, 'auto_scenario', 12, 'ready'),
('root-03-m03-a06-reflection', 'root-03-m03-everyday-git', 6, 'reflection', 'Reflection: You Have Real, Permanent History Now',
'content/root/root-03-git-collaborative-development/m03-everyday-git/05-reflection.md', NULL, NULL, 'manual_marker', 8, 'ready'),
-- M04
('root-03-m04-a01-lesson', 'root-03-m04-branching-and-merging', 1, 'lesson', 'Branching and Merging',
'content/root/root-03-git-collaborative-development/m04-branching-and-merging/01-lesson-branching-and-merging.md', NULL, NULL, 'manual_marker', 15, 'ready'),
('root-03-m04-a02-demonstration', 'root-03-m04-branching-and-merging', 2, 'demonstration', 'Demonstration: A Conflict, Caused and Resolved on Purpose',
'content/root/root-03-git-collaborative-development/m04-branching-and-merging/02-demonstration-a-conflict-happening-live.md', NULL, NULL, 'manual_marker', 10, 'ready'),
('root-03-m04-a03-knowledge-check', 'root-03-m04-branching-and-merging', 3, 'knowledge_check', 'Knowledge Check: Branching and Merging',
'content/root/root-03-git-collaborative-development/m04-branching-and-merging/03-knowledge-check.md', NULL, NULL, 'manual_marker', 5, 'ready'),
('root-03-m04-a04-guided-exercise', 'root-03-m04-branching-and-merging', 4, 'guided_exercise', 'Guided Exercise: Decide the Resolution Before You Touch the File',
'content/root/root-03-git-collaborative-development/m04-branching-and-merging/04-guided-exercise-choosing-a-resolution.md', NULL, NULL, 'manual_marker', 10, 'ready'),
('root-03-m04-a05-lab-branching-and-merge', 'root-03-m04-branching-and-merging', 5, 'lab', 'Lab: Resolve a Real Merge Conflict',
NULL, 'git-branching-and-merge', NULL, 'auto_scenario', 15, 'ready'),
('root-03-m04-a06-reflection', 'root-03-m04-branching-and-merging', 6, 'reflection', 'Reflection: Your First Conflict Wasn''t a Disaster',
'content/root/root-03-git-collaborative-development/m04-branching-and-merging/05-reflection.md', NULL, NULL, 'manual_marker', 8, 'ready'),
-- M05
('root-03-m05-a01-lesson', 'root-03-m05-remote-repositories', 1, 'lesson', 'Remote Repositories',
'content/root/root-03-git-collaborative-development/m05-remote-repositories/01-lesson-remote-repositories.md', NULL, NULL, 'manual_marker', 15, 'ready'),
('root-03-m05-a02-demonstration', 'root-03-m05-remote-repositories', 2, 'demonstration', 'Demonstration: A Complete Clone-to-Push Round Trip',
'content/root/root-03-git-collaborative-development/m05-remote-repositories/02-demonstration-clone-commit-push.md', NULL, NULL, 'manual_marker', 8, 'ready'),
('root-03-m05-a03-knowledge-check', 'root-03-m05-remote-repositories', 3, 'knowledge_check', 'Knowledge Check: Remote Repositories',
'content/root/root-03-git-collaborative-development/m05-remote-repositories/03-knowledge-check.md', NULL, NULL, 'manual_marker', 5, 'ready'),
('root-03-m05-a04-guided-exercise', 'root-03-m05-remote-repositories', 4, 'guided_exercise', 'Guided Exercise: Fetch First, Decide Second',
'content/root/root-03-git-collaborative-development/m05-remote-repositories/04-guided-exercise-fetch-vs-pull.md', NULL, NULL, 'manual_marker', 8, 'ready'),
('root-03-m05-a05-lab-remote-clone-push', 'root-03-m05-remote-repositories', 5, 'lab', 'Lab: Clone, Commit, and Push to a Real Remote',
NULL, 'git-remote-clone-push', NULL, 'auto_scenario', 12, 'ready'),
('root-03-m05-a06-reflection', 'root-03-m05-remote-repositories', 6, 'reflection', 'Reflection: You Just Practiced Real Collaboration, Safely',
'content/root/root-03-git-collaborative-development/m05-remote-repositories/05-reflection.md', NULL, NULL, 'manual_marker', 8, 'ready'),
-- M06 (no lab)
('root-03-m06-a01-lesson', 'root-03-m06-engineering-git-workflow', 1, 'lesson', 'Engineering Git Workflow',
'content/root/root-03-git-collaborative-development/m06-engineering-git-workflow/01-lesson-engineering-git-workflow.md', NULL, NULL, 'manual_marker', 15, 'ready'),
('root-03-m06-a02-demonstration', 'root-03-m06-engineering-git-workflow', 2, 'demonstration', 'Demonstration: The Same Change, Told Two Ways',
'content/root/root-03-git-collaborative-development/m06-engineering-git-workflow/02-demonstration-a-bad-commit-vs-a-good-one.md', NULL, NULL, 'manual_marker', 8, 'ready'),
('root-03-m06-a03-knowledge-check', 'root-03-m06-engineering-git-workflow', 3, 'knowledge_check', 'Knowledge Check: Engineering Git Workflow',
'content/root/root-03-git-collaborative-development/m06-engineering-git-workflow/03-knowledge-check.md', NULL, NULL, 'manual_marker', 5, 'ready'),
('root-03-m06-a04-reflection', 'root-03-m06-engineering-git-workflow', 4, 'reflection', 'Reflection: You''ve Practiced Real Engineering Discipline, Not Just Syntax',
'content/root/root-03-git-collaborative-development/m06-engineering-git-workflow/04-reflection.md', NULL, NULL, 'manual_marker', 8, 'ready')
ON CONFLICT (activity_id) DO NOTHING;
-- ═══════════════════════════════════════════════════════════════════════════════════════════
-- ROOT 03 course assessment — mixes real Git-state-validation tasks with knowledge-recall MCQs
-- reasoning about the staging area and diverged branches, via the existing Phase 3B engine.
-- ═══════════════════════════════════════════════════════════════════════════════════════════
INSERT INTO assessment_definitions (assessment_definition_id, type, title, description, duration_minutes, hint_policy, pool_spec, completion_rule)
VALUES (
'rootnode-git-fundamentals-assessment', 'exam', 'ROOT 03 Git & Collaborative Development Assessment',
'A timed check across everyday Git usage, branching/merge-conflict resolution, and remote workflows — combining real repository-state-validation tasks with conceptual reasoning questions.',
35, 'disabled',
'{"required": ["git-everyday-basics", "git-branching-and-merge"],
"random": [
{"count":1,"from":["git-remote-clone-push"]},
{"count":2,"from":["git-staging-area-mcq","git-diverged-branches-mcq"]}
]}',
'{"type":"all_scenarios_passed"}'
) ON CONFLICT (assessment_definition_id) DO NOTHING;
INSERT INTO module_activities (activity_id, module_id, sequence, activity_type, title, content_path, scenario_id, assessment_definition_id, completion_behavior, estimated_duration_minutes, status) VALUES
('root-03-m06-a05-assessment', 'root-03-m06-engineering-git-workflow', 5, 'assessment', 'ROOT 03 Git & Collaborative Development Assessment', NULL, NULL, 'rootnode-git-fundamentals-assessment', 'auto_assessment', 35, 'ready')
ON CONFLICT (activity_id) DO NOTHING;