mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-04-28 16:48:30 -05:00
feat(lint): add JSON validation to pre-commit hooks
Added check-json hook to automatically validate all JSON files on commit. Fixed JSON syntax errors in: - sustainable_ai_quizzes.json (11 missing commas) - cross_refs_no_explanation.json (trailing commas) - cross_refs.json (incomplete file, reset to empty array) All JSON files now pass validation.
This commit is contained in:
@@ -78,6 +78,15 @@ repos:
|
||||
# PHASE 2: BASIC VALIDATORS (Structure and syntax)
|
||||
# =============================================================================
|
||||
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v5.0.0
|
||||
hooks:
|
||||
# --- JSON Validation ---
|
||||
- id: check-json
|
||||
name: "Validate JSON files"
|
||||
files: \.json$
|
||||
description: "Validate all JSON files have correct syntax"
|
||||
|
||||
- repo: local
|
||||
hooks:
|
||||
# --- Project Structure Check ---
|
||||
|
||||
@@ -153,7 +153,7 @@
|
||||
"To prioritize AI model performance over environmental impact.",
|
||||
"To focus on reducing the cost of AI system deployment."
|
||||
],
|
||||
"answer": "The correct answer is A. To integrate environmental considerations into AI system design and development. Ethical AI development requires balancing technological progress with ecological responsibility, ensuring sustainable practices are embedded in system design."
|
||||
"answer": "The correct answer is A. To integrate environmental considerations into AI system design and development. Ethical AI development requires balancing technological progress with ecological responsibility, ensuring sustainable practices are embedded in system design.",
|
||||
"learning_objective": "Understand the ethical responsibilities of AI developers in the context of environmental sustainability."
|
||||
},
|
||||
{
|
||||
@@ -190,7 +190,7 @@
|
||||
"Efficiency improvements have no impact on resource consumption.",
|
||||
"Efficiency improvements are unrelated to AI deployment scale."
|
||||
],
|
||||
"answer": "The correct answer is B. Efficiency improvements can lead to increased overall consumption due to greater accessibility and affordability. Making AI more efficient can lower costs, thereby increasing usage and potentially offsetting the gains from efficiency."
|
||||
"answer": "The correct answer is B. Efficiency improvements can lead to increased overall consumption due to greater accessibility and affordability. Making AI more efficient can lower costs, thereby increasing usage and potentially offsetting the gains from efficiency.",
|
||||
"learning_objective": "Understand the concept of Jevons Paradox and its implications for sustainable AI."
|
||||
},
|
||||
{
|
||||
@@ -208,7 +208,7 @@
|
||||
"Energy-efficient algorithmic design",
|
||||
"Optimized hardware deployment"
|
||||
],
|
||||
"answer": "The correct answer is A. Unlimited scaling of AI applications. This contradicts the sustainable AI framework's goal of managing resource consumption and environmental impact."
|
||||
"answer": "The correct answer is A. Unlimited scaling of AI applications. This contradicts the sustainable AI framework's goal of managing resource consumption and environmental impact.",
|
||||
"learning_objective": "Identify key strategies in the sustainable AI implementation framework."
|
||||
},
|
||||
{
|
||||
@@ -252,7 +252,7 @@
|
||||
"Managing heat dissipation while maintaining performance",
|
||||
"Optimizing battery life versus processing capabilities"
|
||||
],
|
||||
"answer": "The correct answer is A. Maximizing computational efficiency while minimizing latency is a critical trade-off in embedded AI systems. The other options represent different but equally important trade-offs in embedded system design."
|
||||
"answer": "The correct answer is A. Maximizing computational efficiency while minimizing latency is a critical trade-off in embedded AI systems. The other options represent different but equally important trade-offs in embedded system design.",
|
||||
"learning_objective": "Understand the key trade-offs in designing embedded AI systems."
|
||||
},
|
||||
{
|
||||
@@ -270,7 +270,7 @@
|
||||
"Increased consumer demand for durable products",
|
||||
"Falling cost of microelectronics"
|
||||
],
|
||||
"answer": "The correct answer is D. Falling cost of microelectronics drives the disposability of AI-powered devices as it allows for cheaper, short-lived products rather than investing in durable, repairable designs."
|
||||
"answer": "The correct answer is D. Falling cost of microelectronics drives the disposability of AI-powered devices as it allows for cheaper, short-lived products rather than investing in durable, repairable designs.",
|
||||
"learning_objective": "Identify factors contributing to the disposability of AI-powered devices."
|
||||
},
|
||||
{
|
||||
@@ -307,7 +307,7 @@
|
||||
"Data privacy laws",
|
||||
"Emission restrictions"
|
||||
],
|
||||
"answer": "The correct answer is D. Emission restrictions are a primary policy mechanism for sustainable AI governance, directly targeting carbon footprint reduction. Algorithmic optimization and user interface design are technical aspects, while data privacy laws address different regulatory concerns."
|
||||
"answer": "The correct answer is D. Emission restrictions are a primary policy mechanism for sustainable AI governance, directly targeting carbon footprint reduction. Algorithmic optimization and user interface design are technical aspects, while data privacy laws address different regulatory concerns.",
|
||||
"learning_objective": "Understand the primary policy mechanisms involved in sustainable AI governance."
|
||||
},
|
||||
{
|
||||
@@ -363,7 +363,7 @@
|
||||
"The high energy consumption required for AI model training",
|
||||
"The use of AI in wildlife protection"
|
||||
],
|
||||
"answer": "The correct answer is C. The high energy consumption required for AI model training is a significant public concern, as it raises questions about AI's environmental footprint. The other options represent potential benefits of AI for sustainability."
|
||||
"answer": "The correct answer is C. The high energy consumption required for AI model training is a significant public concern, as it raises questions about AI's environmental footprint. The other options represent potential benefits of AI for sustainability.",
|
||||
"learning_objective": "Understand public concerns about AI's environmental impact."
|
||||
},
|
||||
{
|
||||
@@ -413,7 +413,7 @@
|
||||
"Increasing model complexity",
|
||||
"Low-precision numerics"
|
||||
],
|
||||
"answer": "The correct answer is C. Increasing model complexity. Increasing model complexity generally increases computational demand and energy consumption, contrary to the goal of energy efficiency. Techniques like model pruning, quantization, and low-precision numerics are specifically designed to reduce energy use."
|
||||
"answer": "The correct answer is C. Increasing model complexity. Increasing model complexity generally increases computational demand and energy consumption, contrary to the goal of energy efficiency. Techniques like model pruning, quantization, and low-precision numerics are specifically designed to reduce energy use.",
|
||||
"learning_objective": "Understand techniques for energy-efficient AI model development."
|
||||
},
|
||||
{
|
||||
@@ -431,7 +431,7 @@
|
||||
"Inability to track energy consumption",
|
||||
"Need for adaptable frameworks for both hardware and software"
|
||||
],
|
||||
"answer": "The correct answer is D. Need for adaptable frameworks for both hardware and software. AI systems require comprehensive approaches that account for the full environmental impact across both hardware and software components, unlike traditional industries where LCA methodologies are well-established."
|
||||
"answer": "The correct answer is D. Need for adaptable frameworks for both hardware and software. AI systems require comprehensive approaches that account for the full environmental impact across both hardware and software components, unlike traditional industries where LCA methodologies are well-established.",
|
||||
"learning_objective": "Identify challenges in measuring AI's environmental impact."
|
||||
},
|
||||
{
|
||||
@@ -468,13 +468,13 @@
|
||||
"Cloud computing reduces the need for lifecycle analysis.",
|
||||
"Cloud computing inherently minimizes resource consumption."
|
||||
],
|
||||
"answer": "The correct answer is A. Cloud computing automatically makes AI systems more sustainable. This is incorrect because cloud deployment does not inherently provide environmental benefits without considering energy sources and usage patterns. The environmental impact depends on the cloud provider's energy mix and infrastructure efficiency."
|
||||
"answer": "The correct answer is A. Cloud computing automatically makes AI systems more sustainable. This is incorrect because cloud deployment does not inherently provide environmental benefits without considering energy sources and usage patterns. The environmental impact depends on the cloud provider's energy mix and infrastructure efficiency.",
|
||||
"learning_objective": "Identify misconceptions about the environmental impact of cloud computing in AI systems."
|
||||
},
|
||||
{
|
||||
"question_type": "TF",
|
||||
"question": "True or False: Focusing only on operational energy consumption provides a complete picture of an AI system's environmental impact.",
|
||||
"answer": "False. Operational energy consumption is only part of the environmental impact. A comprehensive assessment must include embodied carbon and lifecycle impacts such as hardware manufacturing and disposal."
|
||||
"answer": "False. Operational energy consumption is only part of the environmental impact. A comprehensive assessment must include embodied carbon and lifecycle impacts such as hardware manufacturing and disposal.",
|
||||
"learning_objective": "Understand the importance of considering full lifecycle impacts in AI sustainability."
|
||||
},
|
||||
{
|
||||
@@ -529,7 +529,7 @@
|
||||
"Limited to data center energy consumption",
|
||||
"Primarily during model inference"
|
||||
],
|
||||
"answer": "The correct answer is A. From hardware manufacturing to disposal. The lifecycle impact of AI systems includes all stages from manufacturing, operational energy use, to disposal. Options B, C, and D are incorrect as they only focus on specific phases."
|
||||
"answer": "The correct answer is A. From hardware manufacturing to disposal. The lifecycle impact of AI systems includes all stages from manufacturing, operational energy use, to disposal. Options B, C, and D are incorrect as they only focus on specific phases.",
|
||||
"learning_objective": "Understand the comprehensive lifecycle impact of AI systems."
|
||||
},
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -19,31 +19,31 @@
|
||||
"target_section_id": "sec-dl-primer-biological-artificial-neurons-35ce",
|
||||
"target_section_title": "Biological to Artificial Neurons",
|
||||
"connection_type": "Preview",
|
||||
"similarity": 0.7604076862335205,
|
||||
"similarity": 0.7604076862335205
|
||||
},
|
||||
{
|
||||
"target_section_id": "sec-ai-good-key-ai-applications-d79f",
|
||||
"target_section_title": "Key AI Applications",
|
||||
"connection_type": "Preview",
|
||||
"similarity": 0.6808262467384338,
|
||||
"similarity": 0.6808262467384338
|
||||
},
|
||||
{
|
||||
"target_section_id": "sec-dl-primer-overview-3619",
|
||||
"target_section_title": "Overview",
|
||||
"connection_type": "Preview",
|
||||
"similarity": 0.6649392247200012,
|
||||
"similarity": 0.6649392247200012
|
||||
},
|
||||
{
|
||||
"target_section_id": "sec-ai-good-overview-a2ec",
|
||||
"target_section_title": "Overview",
|
||||
"connection_type": "Preview",
|
||||
"similarity": 0.6615833044052124,
|
||||
"similarity": 0.6615833044052124
|
||||
},
|
||||
{
|
||||
"target_section_id": "sec-dl-primer-evolution-deep-learning-e04f",
|
||||
"target_section_title": "The Evolution to Deep Learning",
|
||||
"connection_type": "Preview",
|
||||
"similarity": 0.6254351139068604,
|
||||
"similarity": 0.6254351139068604
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -55,31 +55,31 @@
|
||||
"target_section_id": "sec-dl-primer-biological-artificial-neurons-35ce",
|
||||
"target_section_title": "Biological to Artificial Neurons",
|
||||
"connection_type": "Preview",
|
||||
"similarity": 0.8035246729850769,
|
||||
"similarity": 0.8035246729850769
|
||||
},
|
||||
{
|
||||
"target_section_id": "sec-dl-primer-overview-3619",
|
||||
"target_section_title": "Overview",
|
||||
"connection_type": "Preview",
|
||||
"similarity": 0.7338806390762329,
|
||||
"similarity": 0.7338806390762329
|
||||
},
|
||||
{
|
||||
"target_section_id": "sec-dl-primer-evolution-deep-learning-e04f",
|
||||
"target_section_title": "The Evolution to Deep Learning",
|
||||
"connection_type": "Preview",
|
||||
"similarity": 0.6687108278274536,
|
||||
"similarity": 0.6687108278274536
|
||||
},
|
||||
{
|
||||
"target_section_id": "sec-ml-systems-overview-5d7e",
|
||||
"target_section_title": "Overview",
|
||||
"connection_type": "Preview",
|
||||
"similarity": 0.6403743028640747,
|
||||
"similarity": 0.6403743028640747
|
||||
},
|
||||
{
|
||||
"target_section_id": "sec-dl-primer-neural-network-fundamentals-63b9",
|
||||
"target_section_title": "Neural Network Fundamentals",
|
||||
"connection_type": "Preview",
|
||||
"similarity": 0.6342458724975586,
|
||||
"similarity": 0.6342458724975586
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -91,31 +91,31 @@
|
||||
"target_section_id": "sec-dl-primer-biological-artificial-neurons-35ce",
|
||||
"target_section_title": "Biological to Artificial Neurons",
|
||||
"connection_type": "Preview",
|
||||
"similarity": 0.6509453058242798,
|
||||
"similarity": 0.6509453058242798
|
||||
},
|
||||
{
|
||||
"target_section_id": "sec-dl-primer-overview-3619",
|
||||
"target_section_title": "Overview",
|
||||
"connection_type": "Preview",
|
||||
"similarity": 0.5961151123046875,
|
||||
"similarity": 0.5961151123046875
|
||||
},
|
||||
{
|
||||
"target_section_id": "sec-dl-primer-evolution-deep-learning-e04f",
|
||||
"target_section_title": "The Evolution to Deep Learning",
|
||||
"connection_type": "Preview",
|
||||
"similarity": 0.5684860944747925,
|
||||
"similarity": 0.5684860944747925
|
||||
},
|
||||
{
|
||||
"target_section_id": "sec-ai-training-training-systems-e99c",
|
||||
"target_section_title": "Training Systems",
|
||||
"connection_type": "Preview",
|
||||
"similarity": 0.5622239708900452,
|
||||
"similarity": 0.5622239708900452
|
||||
},
|
||||
{
|
||||
"target_section_id": "sec-ai-frameworks-overview-7fa2",
|
||||
"target_section_title": "Overview",
|
||||
"connection_type": "Preview",
|
||||
"similarity": 0.5324997901916504,
|
||||
"similarity": 0.5324997901916504
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -132,7 +132,7 @@
|
||||
"target_section_id": "sec-introduction-ai-ml-basics-041a",
|
||||
"target_section_title": "AI and ML Basics",
|
||||
"connection_type": "Background",
|
||||
"similarity": 0.6403743028640747,
|
||||
"similarity": 0.6403743028640747
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -144,7 +144,7 @@
|
||||
"target_section_id": "sec-ai-frameworks-overview-7fa2",
|
||||
"target_section_title": "Overview",
|
||||
"connection_type": "Preview",
|
||||
"similarity": 0.5337989926338196,
|
||||
"similarity": 0.5337989926338196
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -156,7 +156,7 @@
|
||||
"target_section_id": "sec-introduction-ai-ml-basics-041a",
|
||||
"target_section_title": "AI and ML Basics",
|
||||
"connection_type": "Background",
|
||||
"similarity": 0.5427025556564331,
|
||||
"similarity": 0.5427025556564331
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -168,7 +168,7 @@
|
||||
"target_section_id": "sec-introduction-ai-ml-basics-041a",
|
||||
"target_section_title": "AI and ML Basics",
|
||||
"connection_type": "Background",
|
||||
"similarity": 0.6233536005020142,
|
||||
"similarity": 0.6233536005020142
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -180,7 +180,7 @@
|
||||
"target_section_id": "sec-introduction-ai-ml-basics-041a",
|
||||
"target_section_title": "AI and ML Basics",
|
||||
"connection_type": "Background",
|
||||
"similarity": 0.5533028244972229,
|
||||
"similarity": 0.5533028244972229
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -192,7 +192,7 @@
|
||||
"target_section_id": "sec-introduction-ai-ml-basics-041a",
|
||||
"target_section_title": "AI and ML Basics",
|
||||
"connection_type": "Background",
|
||||
"similarity": 0.5021177530288696,
|
||||
"similarity": 0.5021177530288696
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -204,7 +204,7 @@
|
||||
"target_section_id": "sec-introduction-ai-ml-basics-041a",
|
||||
"target_section_title": "AI and ML Basics",
|
||||
"connection_type": "Background",
|
||||
"similarity": 0.5516848564147949,
|
||||
"similarity": 0.5516848564147949
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -216,7 +216,7 @@
|
||||
"target_section_id": "sec-ai-frameworks-overview-7fa2",
|
||||
"target_section_title": "Overview",
|
||||
"connection_type": "Preview",
|
||||
"similarity": 0.735882043838501,
|
||||
"similarity": 0.735882043838501
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user