Appearance
Phase 1 Lab Guide: Building the Deliverables β
Curriculum Source:
docs/plan/01_phase1_engine_and_prompting.md
Target Code Location:labs/phase_1/
Evaluation Skill:lab-evaluator
π― Required Deliverables Specification β
You will implement the following two deliverables from scratch when you are ready:
The Hardened Classifier (
labs/phase_1/src/classifier.py):- A multi-class text categorization engine using Pydantic v2 domain schemas.
- Hardened with NIST AML Unicode normalization, XML delimitation, canary token verification, and anti-extraction directives.
- Must achieve
resistance against a standard 5-attack red-teaming suite while maintaining classification accuracy on benign inputs.
Parameter Stability Report (
labs/phase_1/src/parameter_benchmark.py):- An automated testing script executing a logic puzzle across 20 iterations at
and 20 iterations at . - Generates a Markdown report (
labs/phase_1/PARAMETER_STABILITY_REPORT.md) calculating agreement rates, lexical edit distance (Levenshtein), and token latency.
- An automated testing script executing a logic puzzle across 20 iterations at
ποΈ Lab 1 Architecture: The Hardened Classifier β
Acceptance Criteria: β
- [ ] Uses Python 3.12+ type annotations and Pydantic v2 models (
ConfigDict(frozen=True)). - [ ] Catches prompt injection attempts without crashing.
- [ ] Never reveals the internal canary secret or system prompt.
- [ ] Fully verified by automated
pytesttest suite (labs/phase_1/tests/test_classifier.py).
ποΈ Lab 2 Architecture: Parameter Stability Benchmark β
The Logic Benchmark Problems β
To demonstrate how temperature (
Option A: The Canonical "Strange Sequence" Problem (AI Agents and Applications, Ch. 2, p. 73) β
Definition: A sequence of integers is defined as "strange" if and only if:
- It contains at least two odd numbers (
), AND - The sum of all its odd numbers is divisible by 3 (
). Test Input:
3, 4, 5, 7, 10, 18, 22, 24
Ground Truth Derivation:
- Odd numbers identified:
[3, 5, 7](Count = 3β ) - Sum of odd numbers:
- Divisibility:
, remainder 0 ( β ) - Expected Output:
Strange(with complete reasoning steps)
Option B: The "Palindrome" Verification Problem β
Definition: Determine whether an alphanumeric sentence is a strict palindrome, disregarding whitespace, punctuation, and letter casing. Test Input:
"A man, a plan, a canal: Panama"
Expected Output:True(Normalized:"amanaplanacanalpanama")
Benchmark Metrics to Compute: β
- Semantic Agreement Rate:
at vs. . - Lexical Determinism (Variance): Percentage of responses strictly identical to the mode response.
- Latency Profile: Mean latency and standard deviation (seconds) comparing TTFT and completion duration.
π How to Run & Verify β
bash
# 1. Activate environment
source .venv/bin/activate
# 2. Run automated test suites
pytest labs/phase_1/tests/ -v
# 3. Run the benchmark generator
python labs/phase_1/src/parameter_benchmark.pyOnce verified, you can use the notion-tracker skill to sync the results directly to your Notion page:
text
"Sync Phase 1 lab deliverables and parameter report to my Notion page."