Skip to content

Commit 785f2fe

Browse files
committed
Improve repo review docs and sync validation
1 parent 1e83d6d commit 785f2fe

9 files changed

Lines changed: 279 additions & 73 deletions

File tree

CONTRIBUTING.md

Lines changed: 23 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -14,56 +14,36 @@ Thank you for contributing to this repository.
1414

1515
1. Fork the repository and create a branch for your change.
1616
2. Make focused updates (one topic per pull request when possible).
17-
3. Verify C++ code compiles with:
17+
3. Run the full repository check first:
1818

19-
```bash
20-
g++ -std=c++17 -Wall -Wextra -pedantic <file>.cpp -o <output>
19+
```powershell
20+
./scripts/verify-repo.ps1
2121
```
2222

23-
You can also validate all C++ files with:
24-
25-
- `./scripts/build-all.ps1` (PowerShell)
26-
- `bash ./scripts/build-all.sh` (Bash)
27-
28-
Validate markdown links with:
29-
30-
- `./scripts/check-links.ps1` (PowerShell)
31-
- `bash ./scripts/check-links.sh` (Bash)
32-
33-
Validate README structure with:
34-
35-
- `./scripts/check-readme-structure.ps1` (PowerShell)
36-
- `bash ./scripts/check-readme-structure.sh` (Bash)
37-
38-
Validate module completeness with:
39-
40-
- `./scripts/check-module-completeness.ps1` (PowerShell)
41-
- `bash ./scripts/check-module-completeness.sh` (Bash)
42-
43-
Validate checkpoint completeness with:
44-
45-
- `./scripts/check-checkpoint-completeness.ps1` (PowerShell)
46-
- `bash ./scripts/check-checkpoint-completeness.sh` (Bash)
47-
48-
Validate cross-language parity with:
49-
50-
- `./scripts/check-cross-language-parity.ps1` (PowerShell)
51-
- `bash ./scripts/check-cross-language-parity.sh` (Bash)
52-
53-
Validate exercise parity with:
54-
55-
- `./scripts/check-exercise-parity.ps1` (PowerShell)
56-
- `bash ./scripts/check-exercise-parity.sh` (Bash)
23+
```bash
24+
bash ./scripts/verify-repo.sh
25+
```
5726

58-
Validate example output contracts with:
27+
For a faster loop while you are iterating, use a narrower command on the area you changed:
5928

60-
- `./scripts/check-example-output-contracts.ps1` (PowerShell)
61-
- `bash ./scripts/check-example-output-contracts.sh` (Bash)
29+
- Links: `./scripts/check-links.ps1` or `bash ./scripts/check-links.sh`
30+
- Module README structure: `./scripts/check-readme-structure.ps1` or `bash ./scripts/check-readme-structure.sh`
31+
- Module completeness: `./scripts/check-module-completeness.ps1` or `bash ./scripts/check-module-completeness.sh`
32+
- Checkpoint completeness: `./scripts/check-checkpoint-completeness.ps1` or `bash ./scripts/check-checkpoint-completeness.sh`
33+
- Cross-language parity: `./scripts/check-cross-language-parity.ps1` or `bash ./scripts/check-cross-language-parity.sh`
34+
- Exercise parity: `./scripts/check-exercise-parity.ps1` or `bash ./scripts/check-exercise-parity.sh`
35+
- Example output contracts: `./scripts/check-example-output-contracts.ps1` or `bash ./scripts/check-example-output-contracts.sh`
36+
- Exercise output contracts: `./scripts/check-exercise-output-contracts.ps1` or `bash ./scripts/check-exercise-output-contracts.sh`
37+
- Education audit: `./scripts/audit-education-quality.ps1` or `bash ./scripts/audit-education-quality.sh`
38+
- Lint: `./scripts/lint.ps1` or `bash ./scripts/lint.sh`
39+
- Smoke checks: `./scripts/smoke-languages.ps1` or `bash ./scripts/smoke-languages.sh`
40+
- Compiled-language builds: `./scripts/build-all.ps1` or `bash ./scripts/build-all.sh`
6241

63-
Validate exercise output contracts with:
42+
If you are changing one C++ file and want a local spot check before the full pass, you can still compile it directly with:
6443

65-
- `./scripts/check-exercise-output-contracts.ps1` (PowerShell)
66-
- `bash ./scripts/check-exercise-output-contracts.sh` (Bash)
44+
```bash
45+
g++ -std=c++17 -Wall -Wextra -pedantic <file>.cpp -o <output>
46+
```
6747

6848
For large changes, you can run one language at a time before the full check:
6949

@@ -73,26 +53,6 @@ For large changes, you can run one language at a time before the full check:
7353
- `python scripts/automation.py check-exercise-output-contracts --language cpp`
7454
- `python scripts/automation.py check-exercise-output-contracts --language csharp`
7555

76-
Run full repository checks with:
77-
78-
- `./scripts/verify-repo.ps1` (PowerShell)
79-
- `bash ./scripts/verify-repo.sh` (Bash)
80-
81-
Run multi-language smoke checks with:
82-
83-
- `./scripts/smoke-languages.ps1` (PowerShell)
84-
- `bash ./scripts/smoke-languages.sh` (Bash)
85-
86-
Run language lint checks with:
87-
88-
- `./scripts/lint.ps1` (PowerShell)
89-
- `bash ./scripts/lint.sh` (Bash)
90-
91-
Run the non-blocking education quality audit with:
92-
93-
- `./scripts/audit-education-quality.ps1` (PowerShell)
94-
- `bash ./scripts/audit-education-quality.sh` (Bash)
95-
9656
These smoke checks also compile standalone C# exercises by generating temporary validation projects during the check.
9757
TypeScript checks restore Node dependencies from `package-lock.json`, compile with `tsc`, and execute the emitted JavaScript with `node`.
9858

FULL_REPO_IMPROVEMENT_REVIEW.md

Lines changed: 224 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,224 @@
1+
# Full Repo Improvement Review
2+
3+
Generated: 2026-04-10
4+
5+
## Summary
6+
7+
This repository is already strong on structural consistency, parity coverage, and executable validation. A full local `python scripts/automation.py verify-repo` run passed during this review, including markdown links, README structure, module and checkpoint completeness, documentation sync, example comments, cross-language parity, output contracts, and compiled-language builds.
8+
9+
The main opportunity is no longer "make the repo consistent enough to work." That baseline is in place. The next improvement tier is to reduce drift between docs and reality, raise the quality floor for learner-facing materials that currently pass lightweight checks, and reduce the maintenance burden created by duplicated repo rules across docs, workflow, and manifest-driven automation.
10+
11+
## Baseline Evidence
12+
13+
- `python scripts/automation.py verify-repo` passed locally on 2026-04-10.
14+
- `python scripts/automation.py audit-education-quality` reported:
15+
- 120 module example entry files reviewed
16+
- 30 files below the comment-ratio threshold
17+
- 12 files oversized for their level norms
18+
- 0 files missing observable output markers
19+
- 0 files with boilerplate comment hits
20+
- The current automation surface is centered on `scripts/automation.py`, `scripts/automation_core/ops.py`, and `scripts/automation_manifest.json`.
21+
22+
## Main Strengths
23+
24+
- Cross-language parity is unusually complete for an educational repo: all active tracks reach module and checkpoint parity through `04-expert`.
25+
- The automation core is centralized enough to support repo-wide enforcement instead of ad hoc shell scripts.
26+
- Output contracts for examples and exercises materially reduce silent behavioral drift.
27+
- Module README structure is consistent enough that learners can move between tracks with low navigation friction.
28+
- The anti-pattern backlog is already pointing at high-value content expansion areas instead of random feature work.
29+
30+
## Highest-Value Improvements
31+
32+
1. Standardize learner guidance above the module level, especially for non-C++ tracks, so every level explains outcomes and completion criteria as clearly as C++.
33+
2. Remove documentation drift by tightening track README validation and reducing duplicated status text across the repo.
34+
3. Split dense expert examples into one primary teaching path plus secondary companion examples when a single file currently teaches multiple ideas at once.
35+
4. Rework file I/O entry examples so they better transfer into checkpoint tasks instead of hiding the workflow inside temp-file setup and cleanup.
36+
5. Make the template system actually parity-ready by covering TypeScript and the current example-commenting standard.
37+
6. Treat `scripts/automation_manifest.json` as the canonical metadata source and generate or shrink duplicated doc fragments around it.
38+
7. Raise automation coverage for learner-quality signals that currently rely on manual review.
39+
40+
## Findings Register
41+
42+
### F1. Track README scope text has already drifted from repo reality
43+
44+
- Category: parity and consistency
45+
- Severity: medium
46+
- Learner/maintainer impact: learners get an outdated picture of checkpoint coverage, and maintainers already have doc drift in top-level discovery pages.
47+
- Evidence:
48+
- `languages/csharp/README.md`
49+
- `languages/go/README.md`
50+
- `languages/python/README.md`
51+
- Each still says the track includes "the first checkpoint layer" while also listing `4/4` projects and `4/4` assessments.
52+
- `scripts/automation_core/ops.py` only validates selected marker lines and root status rows, so this mismatch passes current checks.
53+
- Affected scope: three track landing pages and the current doc-sync contract.
54+
- Recommended fix: define one canonical track-status block shape, validate the scope sentence itself, and eliminate freeform status prose where possible.
55+
- Estimated effort: small
56+
- Dependency/risk: low risk; mostly doc and validation work.
57+
58+
### F2. Level-level learner guidance is much stronger in C++ than in the parity tracks
59+
60+
- Category: learner-facing content
61+
- Severity: high
62+
- Learner/maintainer impact: parity exists structurally, but the learner experience is uneven because non-C++ levels give less guidance about outcomes, completion, and pacing.
63+
- Evidence:
64+
- `languages/cpp/01-foundations/README.md`
65+
- `languages/cpp/02-core/README.md`
66+
- C++ level READMEs include `## Level Outcomes` and `## Done When`.
67+
- `languages/go/02-core/README.md`
68+
- `languages/csharp/03-advanced/README.md`
69+
- `languages/python/04-expert/README.md`
70+
- `languages/typescript/01-foundations/README.md`
71+
- These parity tracks mostly stop at module order plus `## Study Tip`.
72+
- Affected scope: all non-C++ level READMEs.
73+
- Recommended fix: adopt a shared level README contract with outcomes, completion checklist, and next-step guidance across every track.
74+
- Estimated effort: medium
75+
- Dependency/risk: medium; this is content-heavy and should avoid making every track sound mechanically identical.
76+
77+
### F3. Repo rules are duplicated across manifest, docs, and workflow, which increases maintenance cost
78+
79+
- Category: structural/tooling
80+
- Severity: high
81+
- Learner/maintainer impact: updating validation policy or track status requires touching multiple files, which invites drift and slows maintenance.
82+
- Evidence:
83+
- `README.md`
84+
- `CONTRIBUTING.md`
85+
- `.github/workflows/cpp-build.yml`
86+
- `scripts/automation_manifest.json`
87+
- `scripts/automation_core/ops.py`
88+
- The repo duplicates validation commands, status summaries, and track metadata across docs, workflow, and automation config.
89+
- Affected scope: root docs, CI workflow, and automation metadata.
90+
- Recommended fix: move status and validation metadata behind one canonical source, then generate or drastically shorten duplicated documentation blocks.
91+
- Estimated effort: medium
92+
- Dependency/risk: medium; generated docs add complexity, but the current duplication is already creating drift.
93+
94+
### F4. Current automation is intentionally permissive in the areas where quality drift is now happening
95+
96+
- Category: structural/tooling
97+
- Severity: high
98+
- Learner/maintainer impact: important content regressions can slip through while the repo still reports a clean verification run.
99+
- Evidence:
100+
- `scripts/automation_core/ops.py`
101+
- `check_readme_structure` validates only module README heading order and metadata.
102+
- `check_doc_sync` validates selected markers, not full semantic accuracy of track docs.
103+
- `check_example_comments` only checks whether an example file has at least one comment.
104+
- `audit_education_quality` is advisory and does not fail CI even when it flags low-comment or oversized examples.
105+
- Affected scope: track READMEs, level READMEs, checkpoint docs, and pedagogical quality enforcement.
106+
- Recommended fix: add stronger non-blocking and blocking checks for track README accuracy, level README completeness, and example complexity thresholds with an allowlist or waiver model.
107+
- Estimated effort: medium
108+
- Dependency/risk: medium; quality checks need calibration to avoid noisy CI.
109+
110+
### F5. Several entry examples teach too many things at once for a "main example" file
111+
112+
- Category: learner-facing content
113+
- Severity: high
114+
- Learner/maintainer impact: learners get a runnable file, but the concept boundary is blurrier than the module title suggests, especially in advanced and expert tracks.
115+
- Evidence:
116+
- `build/reports/education-quality-report.md`
117+
- The audit flags 30 low-comment examples and 12 oversized examples.
118+
- `languages/csharp/04-expert/concurrency-basics/example/main.cs`
119+
- One entry file mixes a locked shared-counter demonstration with a producer-consumer queue walkthrough.
120+
- `languages/csharp/04-expert/performance-and-profiling-basics/example/main.cs`
121+
- One entry file compares both string construction and list-capacity measurement.
122+
- `languages/cpp/03-advanced/structs-and-classes/example/main.cpp`
123+
- One entry file introduces both a plain data struct and a stateful bank-account class.
124+
- Affected scope: the examples already highlighted by the education audit, especially C# expert and selected C++ and TypeScript modules.
125+
- Recommended fix: keep one primary `main.*` scenario per module, move extra demonstrations into companion example files, and increase narration before each conceptual jump.
126+
- Estimated effort: medium to large
127+
- Dependency/risk: low risk technically, but parity updates must stay coordinated across tracks.
128+
129+
### F6. File I/O entry examples are technically correct but weakly aligned with the checkpoint workflow they are supposed to prepare learners for
130+
131+
- Category: learner-facing content
132+
- Severity: medium
133+
- Learner/maintainer impact: learners may understand the API calls but get less practice with the user-facing file workflow they need in projects and assessments.
134+
- Evidence:
135+
- `languages/go/02-core/file-io-basics/example/main.go`
136+
- `languages/typescript/02-core/file-io-basics/example/main.ts`
137+
- Both primary examples create temporary directories/files, do the work, then clean them up.
138+
- `languages/python/projects/02-core/README.md`
139+
- `languages/csharp/projects/02-core/README.md`
140+
- The capstone tasks instead center on user-supplied file paths and persistent report outputs.
141+
- Affected scope: at least the Go and TypeScript file I/O entry modules, and likely sibling implementations in the same concept family.
142+
- Recommended fix: make the main example follow the same mental model as the checkpoint task, then keep temp-file setup as a secondary deterministic example if needed.
143+
- Estimated effort: medium
144+
- Dependency/risk: low risk; output contracts may need updates.
145+
146+
### F7. The repo's onboarding path is thorough but heavier than it needs to be for contributors
147+
148+
- Category: structural/tooling
149+
- Severity: medium
150+
- Learner/maintainer impact: new contributors have to parse a long list of scripts in both `README.md` and `CONTRIBUTING.md`, even though `verify-repo` is the real default path.
151+
- Evidence:
152+
- `README.md`
153+
- `CONTRIBUTING.md`
154+
- Both enumerate many individual validation scripts in full.
155+
- `.github/workflows/cpp-build.yml`
156+
- CI itself effectively runs the consolidated flows rather than presenting the learner with the entire matrix of commands.
157+
- Affected scope: contributor docs and first-time maintainer workflow.
158+
- Recommended fix: keep `verify-repo` as the default contributor command, then document the individual scripts as scoped troubleshooting tools instead of the primary path.
159+
- Estimated effort: small
160+
- Dependency/risk: low risk.
161+
162+
### F8. The concept template is not yet aligned with the repo's current parity-first standards
163+
164+
- Category: parity and consistency
165+
- Severity: medium
166+
- Learner/maintainer impact: new content can start from an outdated scaffold, which increases cleanup work and invites inconsistency.
167+
- Evidence:
168+
- `templates/concept-template/README.md`
169+
- The quick-run section includes C++, Python, Go, and C# examples but omits TypeScript.
170+
- `templates/concept-template/example/main.cpp`
171+
- The stub does not model the required header-comment pattern used by current parity and education-quality checks.
172+
- Affected scope: all future module creation work.
173+
- Recommended fix: upgrade the template to reflect the current five-track repo, current comment conventions, and the intended companion-example pattern where relevant.
174+
- Estimated effort: small
175+
- Dependency/risk: low risk.
176+
177+
## Prioritized Roadmap
178+
179+
### Near-Term
180+
181+
- Fix the stale track-scope statements in `languages/csharp/README.md`, `languages/go/README.md`, and `languages/python/README.md`.
182+
- Simplify contributor onboarding in `README.md` and `CONTRIBUTING.md` so `verify-repo` is the default path and the long script lists become secondary references.
183+
- Upgrade `templates/concept-template/README.md` and `templates/concept-template/example/main.cpp` to match the current five-track, comment-first repo contract.
184+
- Add automation coverage for track README scope/status accuracy so this class of drift cannot recur silently.
185+
186+
### Medium-Term
187+
188+
- Define and roll out a shared level README contract across non-C++ tracks, including level outcomes and completion criteria.
189+
- Expand doc-sync checks to cover level-guide completeness and stronger checkpoint/track consistency rules.
190+
- Use `build/reports/education-quality-report.md` as the queue for targeted example cleanup, starting with the oversized and lowest-comment expert examples.
191+
- Rework `02-core/file-io-basics` entry examples so the primary walkthrough matches checkpoint-style file workflows.
192+
193+
### Later
194+
195+
- Decide whether repo status and validation metadata should be generated from `scripts/automation_manifest.json` or whether docs should be deliberately shortened to avoid duplication.
196+
- Add a second-layer pedagogy review surface that checks concept density, companion-example balance, and track adaptation quality rather than just structure and output.
197+
- Execute the anti-pattern backlog in batches once the level-guide and template improvements reduce future drift.
198+
199+
## What Current Automation Does Not Catch Well
200+
201+
- Semantic accuracy of freeform track overview text.
202+
- Whether level READMEs are equally helpful across languages.
203+
- Whether a module's main example teaches one idea cleanly or several ideas at once.
204+
- Whether checkpoint-prep examples match the mental model of the checkpoint tasks.
205+
- Whether companion examples are being used consistently to keep `main.*` focused.
206+
- Whether the contributor docs are optimized for first use rather than completeness.
207+
208+
## Recommended Next PR Batches
209+
210+
1. Documentation truthfulness and onboarding
211+
- Fix stale track README scope text.
212+
- Simplify top-level contributor instructions.
213+
- Add doc-sync coverage for track overview accuracy.
214+
215+
2. Level-guide parity
216+
- Standardize non-C++ level READMEs around outcomes, done-when criteria, and next-step guidance.
217+
218+
3. Template and automation contract refresh
219+
- Update the concept template for TypeScript and header-comment expectations.
220+
- Strengthen quality checks for level guides and example complexity.
221+
222+
4. High-friction content cleanup
223+
- Start with the examples already flagged by `build/reports/education-quality-report.md`.
224+
- Prioritize C# expert examples and the `02-core/file-io-basics` family across tracks.

README.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ If you only want to learn one track, follow that track README first because lang
4343

4444
1. Read [CONTRIBUTING.md](CONTRIBUTING.md).
4545
2. Install the repo prerequisites listed above.
46-
3. Run `./scripts/verify-repo.ps1` or `bash ./scripts/verify-repo.sh`.
47-
4. Run `./scripts/lint.ps1` or `bash ./scripts/lint.sh` before opening a pull request.
46+
3. Run `./scripts/verify-repo.ps1` or `bash ./scripts/verify-repo.sh` as the default pre-PR check.
47+
4. Use a narrower script only when you want a faster loop on one part of the repo.
4848

4949
## Language Status
5050

@@ -148,7 +148,17 @@ Hand-written example code files under `languages/*/*/*/example/` should use inte
148148

149149
## Validation and CI
150150

151-
Run checks locally:
151+
Use the full repository check by default:
152+
153+
~~~powershell
154+
./scripts/verify-repo.ps1
155+
~~~
156+
157+
~~~bash
158+
bash ./scripts/verify-repo.sh
159+
~~~
160+
161+
Use narrower commands only when you want a faster loop on one area:
152162

153163
~~~powershell
154164
./scripts/check-links.ps1

0 commit comments

Comments
 (0)