Skip to content

Commit e010658

Browse files
Merge pull request #4 from udacity/polish/2026-05-31-7ec10f2
Polish: remove broken Makefile target + smooth post-scrub prose
2 parents de0ca36 + 47ec950 commit e010658

507 files changed

Lines changed: 1085 additions & 2310 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ab-testing/ab-testing-starter/CONSTANTS.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ file is a narrative wrapper that documents **why** each value was
55
chosen, with line references back to the source.
66

77
Modules MUST import these values from `src.constants` rather than
8-
hardcoding the literals. The `make consistency-check` target (wired up
9-
in the initial scaffolding) greps `content/implementation/` for forbidden bare
8+
hardcoding the literals. The `make consistency-check` target (wired up) greps `content/implementation/` for forbidden bare
109
literals (`:8000`, `gpt-5.`, `ada-002`, `gpt-3.5`, etc.) — using the
1110
constant guarantees a consistency-check pass.
1211

@@ -17,7 +16,7 @@ constant guarantees a consistency-check pass.
1716
| `SERVICE_PORT` | `8080` | 23 | Matches capstone `project/Makefile:35`. 8000 is reserved for Phoenix UI mirrors and learner-local apps. |
1817
| `QUERY_ROUTE` | `/query` | 24 | Matches capstone `project/src/gateway/routes.py:61`. Cross-starter route parity. |
1918
| `HEALTH_ROUTE` | `/health` | 25 | Matches capstone `project/src/gateway/routes.py:106` (NOT `/healthz`). Kubernetes-style convention deferred to match course precedent. |
20-
| `MODEL_COMPLEX` | `gpt-4o` | 28 | Matches capstone `project/src/pricing.py:20`. Locked into `src/pricing.py` cost-table when the initial scaffolding lands. |
19+
| `MODEL_COMPLEX` | `gpt-4o` | 28 | Matches capstone `project/src/pricing.py:20`. Locked into `src/pricing.py` cost-table at scaffolding. |
2120
| `MODEL_SIMPLE` | `gpt-4o-mini` | 29 | Matches capstone `project/src/pricing.py:21`. Used by the simple-vs-complex router (Module 18). |
2221
| `EMBEDDING_MODEL` | `text-embedding-3-small` | 30 | Matches capstone. 1536-dim, cheap, sufficient quality for documentation retrieval. |
2322
| `EMBEDDING_DIM` | `1536` | 31 | OpenAI default for `text-embedding-3-small`. Asserted at Chroma collection create time (Module 05). |
@@ -28,11 +27,11 @@ constant guarantees a consistency-check pass.
2827
| `GENERATION_TEMPERATURE` | `0.2` | 38 | Docs assistant: low temperature for factual recall. Not zero so the generator can paraphrase. |
2928
| `GOLDEN_SET_SIZE` | `30` | 41 | Matches capstone. Large enough for variance, small enough that judge-API cost stays under $1/sweep. |
3029
| `JUDGE_TEMPERATURE` | `0.0` | 42 | Deterministic grading. The judge is a comparator, not a generator. |
31-
| `CACHE_SIMILARITY_THRESHOLD` | `0.85` | 45 | Matches capstone semantic cache. Empirically tuned — see capstone the initial scaffolding history. |
30+
| `CACHE_SIMILARITY_THRESHOLD` | `0.85` | 45 | Matches capstone semantic cache. Empirically tuned — see capstone history. |
3231
| `COST_LOG_PATH` | `data/cost_log.jsonl` | 48 | Matches capstone. JSONL is append-only and grep-friendly. |
3332
| `PHOENIX_PORT` | `6006` | 51 | Matches capstone. Phoenix's documented default; conflicts only with TensorBoard, which Course 2 doesn't use. |
3433
| `PHOENIX_PROJECT_NAME` | `scikitdocs` | 52 | **Intentionally distinct** from capstone's `llm-ops-capstone` so learners running both side-by-side see separate trace streams. |
35-
| `CLIENT_ID_HEADER` | `X-Client-Id` | 55 | Module 22 sticky-by-user A/B bucketing key. Cross-module contract — verified by `tests/test_smoke.py` after the initial scaffolding. |
34+
| `CLIENT_ID_HEADER` | `X-Client-Id` | 55 | Module 22 sticky-by-user A/B bucketing key. Cross-module contract — verified by `tests/test_smoke.py` post-scaffolding. |
3635
| `OPENAI_BASE_URL_ENV` | `OPENAI_BASE_URL` | 58 | Matches memory `project_vocareum_deployment.md`. The openai SDK reads this directly via env. |
3736
| `VOCAREUM_BASE_URL` | `https://openai.vocareum.com/v1` | 59 | Vocareum proxy URL — used when learners have a `voc-` API key. |
3837

ab-testing/ab-testing-starter/INTERFACES.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Frozen interfaces — ScikitDocs starter
22

3-
These signatures are locked at the initial scaffolding. Each impl REQ fills in the body
3+
These signatures are locked at scaffolding. Each downstream module fills in the body
44
of the file its module teaches. Changing a signature requires the
55
upstream-patchback or infra-amendment protocols documented in
66
`docs/plans/2026-05-17-feat-rewrite-impl-modules-scikitdocs-altworkload-plan.md`
@@ -12,7 +12,7 @@ docstring contract**. The downstream modules depend on this shape.
1212

1313
## Frozen function contracts
1414

15-
### `src/corpus.py` — filled by the initial scaffolding (Wave 4 infra)
15+
### `src/corpus.py` — filled by Wave 4 infra
1616

1717
```python
1818
def load_corpus(repo_path: Path, version_sha: str) -> Iterator[dict]
@@ -47,7 +47,7 @@ def embed_query(text: str) -> list[float]
4747
```
4848

4949
`embed` MUST send a single batched OpenAI request when given a list. The
50-
batched-load path (the initial scaffolding `scripts/load_data.py`) targets ≥256 chunks per
50+
batched-load path (`scripts/load_data.py`) targets ≥256 chunks per
5151
request.
5252

5353
### `src/store.py` — filled by Module 05
@@ -87,7 +87,7 @@ End-to-end RAG composition: `embed_query` → `store.query` →
8787

8888
| File | Filled by | Module |
8989
|---|---|---|
90-
| `src/corpus.py` | the initial scaffolding | (infra) |
90+
| `src/corpus.py` | scaffolded | (infra) |
9191
| `src/chunker.py` | Module 05 |
9292
| `src/embedder.py` | Module 05 |
9393
| `src/store.py` | Module 05 |
@@ -104,13 +104,13 @@ End-to-end RAG composition: `embed_query` → `store.query` →
104104

105105
## Cross-module contracts
106106

107-
### `X-Client-Id` header contract (the initial scaffolding → the initial scaffolding)
107+
### `X-Client-Id` header contract
108108

109109
The gateway accepts an optional `X-Client-Id` request header
110-
(`constants.CLIENT_ID_HEADER`). When present, the initial scaffolding (Module 22 A/B
110+
(`constants.CLIENT_ID_HEADER`). When present, Module 22 (A/B
111111
testing) uses the header value as the bucketing key for
112112
sticky-by-user variant assignment. A contract test in
113-
`tests/test_smoke.py` (added by the initial scaffolding) verifies the header is
113+
`tests/test_smoke.py` (added at scaffolding) verifies the header is
114114
plumbed end-to-end before Module 22 lands.
115115

116116
### Collection naming

ab-testing/ab-testing-starter/Makefile

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -71,49 +71,3 @@ test: ## Run the unit + smoke test suite
7171

7272
verify: ## Run lint + tests (placeholder; per-module checks added by downstream modules)
7373
uv run pytest tests/ -q
74-
75-
consistency-check: ## Grep for forbidden cross-module literals across content/implementation/
76-
@# Run from repo root; the starter Makefile is invoked from the project root,
77-
@# so ../../ reaches the course-content tree. Forbidden literals fall into three classes:
78-
@# 1. Wrong gateway port — the starter binds :8080. `localhost:8000` would be wrong;
79-
@# `vllm-host:8000` is allowed (Module 18's vLLM-upstream sidebar — distinct host).
80-
@# 2. Stale model identifiers — `gpt-5.` is a placeholder for a not-yet-released model
81-
@# and should never appear as a real reference.
82-
@# 3. Capstone-workload leakage in subject position — `pickleball` / `ThirdShotHub` /
83-
@# `paddle` appearing as the working corpus or sample-data subject (e.g., "the
84-
@# pickleball corpus", "paddle_weight feature"). Cross-workload comparison lines
85-
@# that name the capstone explicitly (e.g., "the capstone at project/ uses
86-
@# pickleball; ScikitDocs uses scikit-learn docs") are intentional and excluded by
87-
@# the `capstone|ScikitDocs|alt-workload|prior version|swaps from` co-occurrence.
88-
@hits=0; \
89-
scan_strict() { \
90-
pattern=$$1; label=$$2; \
91-
matches=$$(grep -rnE "$$pattern" ../../content/implementation/ 2>/dev/null | grep -v '\.j2:' || true); \
92-
if [ -n "$$matches" ]; then \
93-
echo "[FAIL] $$label '$$pattern' (no context exclusion):"; \
94-
echo "$$matches" | sed 's/^/ /'; \
95-
hits=$$((hits+1)); \
96-
fi; \
97-
}; \
98-
scan_contextual() { \
99-
pattern=$$1; label=$$2; allowctx=$$3; \
100-
matches=$$(grep -rnE "$$pattern" ../../content/implementation/ 2>/dev/null \
101-
| grep -vE "$$allowctx" || true); \
102-
if [ -n "$$matches" ]; then \
103-
echo "[FAIL] $$label '$$pattern' outside allowed context ($$allowctx):"; \
104-
echo "$$matches" | sed 's/^/ /'; \
105-
hits=$$((hits+1)); \
106-
fi; \
107-
}; \
108-
scan_strict 'localhost:8000' 'wrong-port literal'; \
109-
scan_strict 'gpt-5\.' 'placeholder model literal'; \
110-
scan_contextual '\bpickleball\b' 'capstone-workload leakage' 'capstone|ScikitDocs|alt-workload|prior |swap|paired'; \
111-
scan_contextual 'ThirdShotHub' 'capstone-workload leakage' 'capstone|ScikitDocs|alt-workload|workload'; \
112-
scan_contextual '\bpaddle\b' 'capstone-workload leakage' 'capstone|swap|Paddletek|prior|alt-workload'; \
113-
scan_contextual '\b(ada-002|gpt-3\.5)\b' 'stale model name' 'tiktoken|encoding|legacy|cl100k|o200k|p50k|historical|deprecated|tokenizer'; \
114-
if [ $$hits -eq 0 ]; then \
115-
echo "[PASS] no forbidden literals across content/implementation/"; \
116-
else \
117-
echo "[FAIL] $$hits forbidden-literal hit(s); fix the rewrite or extend allowed-context list."; \
118-
exit 1; \
119-
fi

ab-testing/ab-testing-starter/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ make test # smoke test passes immediately at scaffold time
7878
```
7979

8080
Each implementation module's exercise extends the starter incrementally.
81-
Run `make serve` after the initial scaffolding (Module 18 gateway) lands. Run `make eval`
82-
after the initial scaffolding (Module 11 evaluation) lands. See each module's `code-refs.md`
81+
Run `make serve` after Module 18 (gateway) lands. Run `make eval`
82+
after Module 11 (evaluation) lands. See each module's `code-refs.md`
8383
for the prerequisite REQs.
8484

8585
### Populating the corpus (`make load-data`)
@@ -111,5 +111,5 @@ Cost per cold build is ~$0.08–0.15 against `text-embedding-3-small`.
111111
## Provenance
112112

113113
- Plan: [`docs/plans/2026-05-17-feat-rewrite-impl-modules-scikitdocs-altworkload-plan.md`](../../docs/plans/2026-05-17-feat-rewrite-impl-modules-scikitdocs-altworkload-plan.md)
114-
- Scaffold REQ: the initial scaffolding plan (post-archive path)
115-
- Capstone constraint: zero edits to `project/` from any Wave 4 REQ. Verified at the initial scaffolding.
114+
- Scaffold REQ: the initial scaffolding plan
115+
- Capstone constraint: zero edits to `project/` from any Wave 4 module. Verified at scaffolding.

ab-testing/ab-testing-starter/data/SEEDING_NOTES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ print('seeded count:', c.count(where={'is_seeded': True}))
102102
"
103103
```
104104

105-
## Cross-check of 5 golden rows against scikit-learn.org (the initial scaffolding acceptance)
105+
## Cross-check of 5 golden rows against scikit-learn.org
106106

107107
Verified 2026-05-18 against `https://scikit-learn.org/stable/`:
108108

ab-testing/ab-testing-starter/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ dependencies = [
1717
"tiktoken>=0.7,<1",
1818
# Templating — Module 03 uses src/generator.py + prompts/
1919
"jinja2>=3.1,<4",
20-
# RST parsing for scikit-learn doc/*.rst — the initial scaffolding
20+
# RST parsing for scikit-learn doc/*.rst
2121
"docutils>=0.21,<1",
2222
# Evaluation — Module 11
2323
"ragas==0.4.3",

ab-testing/ab-testing-starter/scripts/ab_analyze.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""A/B log analyzer for Module 22 / the initial scaffolding.
1+
"""A/B log analyzer for Module 22.
22
33
Reads ``data/ab_log.jsonl`` (written by ``src.optimization.ab.log_assignment``
44
in the learner's Exercise 1 harness), builds a 2×2 variant-by-success

ab-testing/ab-testing-starter/scripts/load_data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
currently resolves to (Module 24 blue/green) with
2222
``hnsw:space=cosine`` pinned at create time. Pre-Module 24 starters and
2323
fresh checkouts with no ``data/ACTIVE_COLLECTION`` file land in
24-
the literal ``scikit_docs`` collection — the initial scaffolding's original
24+
the literal ``scikit_docs`` collection — the original
2525
behaviour. Chroma's metadata columns are scalar-only, so
2626
list-typed fields (xrefs, code_languages) are JSON-serialised on
2727
the way in.
@@ -277,7 +277,7 @@ def _make_chroma_collection() -> "chromadb.Collection":
277277
silently writing to the pre-alias ``scikit_docs`` collection. When
278278
no ``data/ACTIVE_COLLECTION`` file exists (bootstrap / pre-Module 24
279279
starter) the resolver returns the literal ``scikit_docs`` and
280-
behaviour matches the initial scaffolding's original code path.
280+
behaviour matches the original code path.
281281
"""
282282
from src import store
283283

ab-testing/ab-testing-starter/src/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
CONFIDENCE_THRESHOLD: float = 0.7
3131
GENERATION_TEMPERATURE: float = 0.2
3232

33-
# === Evaluation (RAGAS) — the initial scaffolding / Module 11 ===
33+
# === Evaluation (RAGAS) — Module 11 ===
3434
GOLDEN_SET_SIZE: int = 30
3535
JUDGE_TEMPERATURE: float = 0.0
3636

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Cost monitoring package — JSONL log + summarization + HTML dashboard.
22
3-
Filled by the initial scaffolding (Module 13 Cost Monitoring). The capstone keeps the
3+
Filled by Module 13 (Cost Monitoring). The capstone keeps the
44
same split between ``tracker`` (pure functions over the JSONL log) and
55
``dashboard`` (FastAPI router rendering an HTML report).
66
"""

0 commit comments

Comments
 (0)