Merge pull request #1616 from harvard-edge/fix/tito-status-m3

fix(tinytorch): tito module status milestone tracking (#1612, #1615)
This commit is contained in:
Vijay Janapa Reddi
2026-04-30 19:04:16 -04:00
committed by GitHub

View File

@@ -1505,12 +1505,15 @@ class ModuleWorkflowCommand(BaseCommand):
self.console.print(status_table)
self.console.print()
# Milestones section (if any are unlocked)
# Milestones section (if any are unlocked or ready)
# Show every milestone with state — slicing to the first few hid later
# milestones once early ones were unlocked (issue #1615), so students
# never saw that milestones 04+ were ready to be unlocked.
if completed_count >= 1:
milestone_unlocks = self._check_milestone_readiness(completed)
if milestone_unlocks:
self.console.print("[bold magenta]🏆 Milestones Unlocked:[/bold magenta]")
for milestone_id, milestone_name, ready in milestone_unlocks[:3]: # Show first 3
for milestone_id, milestone_name, ready in milestone_unlocks:
if ready == "unlocked":
self.console.print(f" [magenta]✅ {milestone_id} - {milestone_name}[/magenta]")
elif ready == "ready":
@@ -1531,16 +1534,24 @@ class ModuleWorkflowCommand(BaseCommand):
return 0
def _check_milestone_readiness(self, completed_modules: list) -> list:
"""Check which milestones are unlocked or ready."""
"""Check which milestones are unlocked or ready.
The required-modules list for each milestone must match the canonical
definition in ``tito milestone`` (``MILESTONE_SCRIPTS`` in
``tinytorch/tito/commands/milestone.py``) and in
``_get_milestone_for_module`` above. Diverging copies have caused
``tito module status`` to advertise milestones as ready before the
student has actually completed every prerequisite module (issue #1612).
"""
import json
milestones = [
("01", "Perceptron (1958)", [1, 2, 3]),
("02", "XOR Crisis (1969)", [1, 2, 3]),
("03", "MLP Revival (1986)", [1, 2, 3, 4, 5, 6]),
("04", "CNN Revolution (1998)", [1, 2, 3, 4, 5, 6, 8, 9]),
("05", "Transformer Era (2017)", [1, 2, 3, 4, 5, 6, 11, 12, 13]),
("06", "MLPerf (2018)", [1, 2, 3, 4, 5, 6, 14, 15, 16, 17, 18, 19]),
("03", "MLP Revival (1986)", [1, 2, 3, 4, 5, 6, 7, 8]),
("04", "CNN Revolution (1998)", [1, 2, 3, 4, 5, 6, 7, 8, 9]),
("05", "Transformer Era (2017)", [1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13]),
("06", "MLPerf (2018)", [1, 2, 3, 4, 5, 6, 7, 8, 14, 15, 16, 17, 18, 19]),
]
# Check which milestones have been completed (run successfully)