Level 4 / Project 10 - Run Manifest Generator¶
Home: README
Learn Your Way¶
| Read | Build | Watch | Test | Review | Visualize | Try |
|---|---|---|---|---|---|---|
| — | This project | — | — | Flashcards | — | Browser |
Estimated time: 65 minutes
Focus¶
- artifact manifest and run metadata
Why this project exists¶
This project gives you level-appropriate practice in a realistic operations context. Goal: run the baseline, alter behavior, break one assumption, recover safely, and explain the fix.
Run (copy/paste)¶
Use <repo-root> as the folder containing this repository's README.md.
cd <repo-root>/projects/level-4/10-run-manifest-generator
python project.py --dir data --output data/manifest.json --run-id my-batch-001
pytest -q
Expected terminal output¶
Expected artifacts¶
data/manifest.json— file inventory with checksums and metadata- Passing tests
- Updated
notes.md
Checkpoint: Baseline code runs and all tests pass. Commit your work before continuing.
Alter it (required) — Extension¶
- Add a
--algorithmflag supportingsha256in addition tomd5. - Add a
--excludeglob pattern to skip certain files (e.g.,*.json). - Re-run script and tests — add a test for SHA-256 checksums.
Break it (required) — Core¶
- Point
--dirat a non-existent directory and observe the error. - Create a very large file (10 MB+) and verify the chunked checksum still works.
- Create a directory with symlinks and see if they are followed or skipped.
Fix it (required) — Core¶
- Add a
--no-follow-symlinksoption to skip symbolic links. - Handle permission errors gracefully (log a warning, skip the file).
- Re-run until all tests pass.
Checkpoint: All modifications done, tests still pass. Good time to review your changes.
Explain it (teach-back)¶
- Why does
compute_checksumread in 8192-byte chunks instead of the whole file at once? - What is the difference between
iterdir()andrglob("*")inscan_files? - Why does the manifest include timestamps and how would you use them for change detection?
- What are the security considerations of using MD5 vs. SHA-256 for checksums?
Mastery check¶
You can move on when you can: - run baseline without docs, - explain one core function line-by-line, - break and recover in one session, - keep tests passing after your change.
Related Concepts¶
| ← Prev | Home | Next → |
|---|---|---|