feat: Add experimental physics workflow support (3 protocols + 1 agent)#255
feat: Add experimental physics workflow support (3 protocols + 1 agent)#255matt435 wants to merge 2 commits into
Conversation
GPD currently has no first-class support for physical/laboratory experiments — all 57 protocols and 24 verification checks target theoretical derivations and numerical simulations. This PR adds the foundation for experimental physics workflows. New protocols (src/gpd/specs/references/protocols/): - experimental-data-reduction.md: dead time, pile-up, background subtraction, efficiency corrections, calibration application, systematic uncertainty propagation through correction chain - instrument-systematic-budget.md: GUM-compliant Type A/B uncertainty classification, calibration traceability, drift monitoring, budget combination with correlations, control charts - measurement-reproducibility.md: run-to-run stability via Allan variance, operator dependence testing, environmental sensitivity characterization, cross-apparatus E_n comparison, blind analysis New agent (src/gpd/agents/): - gpd-lab-designer.md: designs physical measurement protocols, calibration plans, systematic budgets, and reproducibility strategies. Produces LAB-DESIGN.md parallel to experiment-designer's EXPERIMENT-DESIGN.md. Same authority model (coordination role, orchestrator commit, return_only state). Registry updates: - protocol-domains.json: new "experimental_methods" domain category - config.py MODEL_PROFILES: gpd-lab-designer tier assignments - registry.py: gpd-lab-designer category mapping - set-profile.md: agent count 24 → 25 - test_config.py: agent count assertion 24 → 25 All protocols follow established conventions: YAML frontmatter with load_when triggers, structured steps, common LLM error patterns (8 per protocol), worked examples with wrong/correct approaches, and verification checklists. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
|
📝 WalkthroughWalkthroughA new lab-experiment design agent ( ChangesLab Designer Agent and Supporting Protocols
sequenceDiagram
participant User as Requester
participant Agent as gpd-lab-designer
participant Context as ContextLoader
participant Design as DesignComposer
participant CalPlan as CalibrationPlanner
participant Protocol as MeasurementProtocol
participant Budget as UncertaintyBudget
participant Repro as ReproPlan
participant Executor as Executor
User->>Agent: request lab design
Agent->>Context: load state, conventions, prior results
Context->>Design: identify measurand & SNR feasibility
Design->>CalPlan: specify calibration strategy & traceability
CalPlan->>Protocol: author measurement protocol and sequencing
Protocol->>Budget: build systematic uncertainty budget
Budget->>Repro: define reproducibility checks and monitoring
Repro->>Executor: emit LAB-DESIGN.md and gpd_return envelope
🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Nitpick comments (3)
src/gpd/specs/references/protocols/measurement-reproducibility.md (1)
66-68: ⚡ Quick winAdd fence languages for markdownlint compliance and stable parsing.
Unlabeled fenced blocks trigger MD040 across the document. Add explicit languages (
text,yaml, ormarkdown) for all code blocks.Also applies to: 118-120, 128-130, 203-205, 209-211, 229-231, 252-254, 280-282, 309-351, 378-384, 401-409, 414-419, 430-433, 437-439, 447-449, 451-459, 467-475, 483-496
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/gpd/specs/references/protocols/measurement-reproducibility.md` around lines 66 - 68, The markdown contains unlabeled fenced code blocks (example: the block with "chi^2 = sum((x_i - x_bar)^2 / sigma_i^2)") which triggers MD040; update every fenced block in this spec to include an explicit language tag (e.g., ```text, ```markdown, ```yaml or ```math where appropriate) so the parser/linter recognizes them—ensure you modify the chi^2 block and all other fenced sections referenced in the review to use the correct language label for their content.src/gpd/specs/references/protocols/experimental-data-reduction.md (1)
100-102: ⚡ Quick winAdd language identifiers to fenced blocks.
These unlabeled fences trigger MD040 and reduce downstream tooling consistency. Tag math/calculation blocks as
text(orlatexwhere appropriate).Also applies to: 130-132, 153-156, 183-185, 193-195, 251-254, 330-332, 412-416, 419-423, 430-434, 437-441, 447-450, 455-457, 460-462, 465-468, 472-474
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/gpd/specs/references/protocols/experimental-data-reduction.md` around lines 100 - 102, The Markdown contains unlabeled fenced code/math blocks (e.g., the formula block starting with "sigma(n_true) / n_true = ..." and the other occurrences you listed) which trigger MD040; update each triple-backtick fence to include a language identifier such as "text" or "latex" (e.g., change ``` to ```text or ```latex) for all instances referenced (lines 100-102, 130-132, 153-156, 183-185, 193-195, 251-254, 330-332, 412-416, 419-423, 430-434, 437-441, 447-450, 455-457, 460-462, 465-468, 472-474) so the math/calculation blocks are explicitly labeled for downstream tooling.src/gpd/agents/gpd-lab-designer.md (1)
112-114: ⚡ Quick winFix markdownlint violations to keep examples machine-safe and consistently rendered.
Multiple fenced blocks lack a language tag, and formula lines with
*in prose/table cells can misrender as emphasis. Add code fence languages (text,yaml,markdown) and escape/format multiplication symbols in table content.Also applies to: 166-168, 205-207, 238-249, 339-347, 357-359, 619-624, 663-683, 743-753
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/gpd/agents/gpd-lab-designer.md` around lines 112 - 114, Several fenced code blocks and table/prose cells are missing language tags and the asterisk (*) in lines like "Physical quantity -> Transducer -> Signal conditioning -> Digitization -> Recorded value" (and other ranges listed) can be misinterpreted as emphasis; update each fenced block by adding an appropriate language tag (e.g., ```text, ```yaml, or ```markdown) and escape or neutralize multiplication/asterisk characters inside prose/table cells (either prefix with a backslash \* or wrap the expression in inline code backticks) so markdownlint no longer flags them — apply these fixes to the noted sections (112-114, 166-168, 205-207, 238-249, 339-347, 357-359, 619-624, 663-683, 743-753).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/gpd/agents/gpd-lab-designer.md`:
- Around line 962-989: The file defines two conflicting return formats (the
legacy top-level payload like status/design_file/... and the canonical
gpd_return envelope), which can break orchestrator parsing; remove or convert
the legacy block so the agent always returns only the canonical gpd_return
structure (use gpd_return as the sole top-level key), map legacy fields (status,
design_file, summary, key_decisions, warnings, reason, needed_from,
partial_design) into appropriate places inside gpd_return (e.g., summary →
gpd_return.summary, design_file → gpd_return.artifacts or
gpd_return.design_file, status → gpd_return.status, and blocked/failure details
into gpd_return.issues or gpd_return.next_actions), and update any examples/docs
in this file referencing LAB-DESIGN.md or the legacy schema to use the
gpd_return envelope and the <structured_returns>/gpd_return contract only.
In `@src/gpd/specs/references/protocols/experimental-data-reduction.md`:
- Around line 73-75: The dead-time labels and formulas are swapped; update the
table so "Non-extending" is paired with "non-paralyzable" and the formula n_true
= n_obs / (1 - n_obs × tau), and "Extending" is paired with "paralyzable" with a
note that a numerical (or Lambert W) solution is required (e.g., n_true =
-W(-n_obs × tau)/tau) instead of the current -ln(...) expression; change the
text for the rows containing "Non-extending (paralyzable)" and "Extending
(non-paralyzable)" to "Non-extending (non-paralyzable)" and "Extending
(paralyzable)" and update the corresponding formula cells and the "Numerical
solution required" note for the paralyzable case.
In `@src/gpd/specs/references/protocols/instrument-systematic-budget.md`:
- Line 499: The Markdown table row beginning "2. Wavelength cal: certificate
states U = ± 0.5 nm ..." is malformed due to extra pipe characters inside a cell
("| 0.00% (at peak; up to 0.5% on flank) | ∞ |") which breaks column alignment;
fix it by removing or escaping the internal pipes so the row has the same number
of columns as the header (e.g., replace the inner pipes with escaped pipes or
wrap the cell in code/backticks, or reformat the cell content to "0.00% (at
peak; up to 0.5% on flank); ∞"), and verify the row now aligns with the table
headers in the file's table row that starts with "2. Wavelength cal".
- Around line 477-499: The worked example shows conflicting values for Source 1
(Absorbance repeatability): keep only the corrected relative uncertainty (u_1 =
0.114%) throughout the document and remove or clearly mark as discarded the
earlier 0.48% draft value; specifically update the table row for "1. Absorbance
repeatability" to show 0.114% (and ν = 4), and edit the narrative lines that
recalculate u_1 (the paragraph referencing u_1/A and t-factor) so they present
the corrected computation only.
In `@src/gpd/specs/references/protocols/measurement-reproducibility.md`:
- Around line 258-263: The Markdown table in the E_n interpretation block is
broken because literal pipe characters in the expressions (e.g. |E_n| <= 1.0)
are being parsed as column delimiters; update the E_n table rows in
measurement-reproducibility.md (the rows containing the |E_n| expressions) by
escaping the pipes or enclosing the expressions in code spans/backticks so the
table columns render correctly while preserving the intended math text.
---
Nitpick comments:
In `@src/gpd/agents/gpd-lab-designer.md`:
- Around line 112-114: Several fenced code blocks and table/prose cells are
missing language tags and the asterisk (*) in lines like "Physical quantity ->
Transducer -> Signal conditioning -> Digitization -> Recorded value" (and other
ranges listed) can be misinterpreted as emphasis; update each fenced block by
adding an appropriate language tag (e.g., ```text, ```yaml, or ```markdown) and
escape or neutralize multiplication/asterisk characters inside prose/table cells
(either prefix with a backslash \* or wrap the expression in inline code
backticks) so markdownlint no longer flags them — apply these fixes to the noted
sections (112-114, 166-168, 205-207, 238-249, 339-347, 357-359, 619-624,
663-683, 743-753).
In `@src/gpd/specs/references/protocols/experimental-data-reduction.md`:
- Around line 100-102: The Markdown contains unlabeled fenced code/math blocks
(e.g., the formula block starting with "sigma(n_true) / n_true = ..." and the
other occurrences you listed) which trigger MD040; update each triple-backtick
fence to include a language identifier such as "text" or "latex" (e.g., change
``` to ```text or ```latex) for all instances referenced (lines 100-102,
130-132, 153-156, 183-185, 193-195, 251-254, 330-332, 412-416, 419-423, 430-434,
437-441, 447-450, 455-457, 460-462, 465-468, 472-474) so the math/calculation
blocks are explicitly labeled for downstream tooling.
In `@src/gpd/specs/references/protocols/measurement-reproducibility.md`:
- Around line 66-68: The markdown contains unlabeled fenced code blocks
(example: the block with "chi^2 = sum((x_i - x_bar)^2 / sigma_i^2)") which
triggers MD040; update every fenced block in this spec to include an explicit
language tag (e.g., ```text, ```markdown, ```yaml or ```math where appropriate)
so the parser/linter recognizes them—ensure you modify the chi^2 block and all
other fenced sections referenced in the review to use the correct language label
for their content.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 49884397-05b1-4efd-9294-cf46ce291a40
📒 Files selected for processing (9)
src/gpd/agents/gpd-lab-designer.mdsrc/gpd/core/config.pysrc/gpd/registry.pysrc/gpd/specs/references/protocols/experimental-data-reduction.mdsrc/gpd/specs/references/protocols/instrument-systematic-budget.mdsrc/gpd/specs/references/protocols/measurement-reproducibility.mdsrc/gpd/specs/references/protocols/protocol-domains.jsonsrc/gpd/specs/workflows/set-profile.mdtests/core/test_config.py
| | **Non-extending (paralyzable)** | n_true = n_obs / (1 - n_obs × tau) | Detector resets after fixed time tau regardless of new events (e.g., Geiger-Mueller counter, scaler with fixed dead time) | | ||
| | **Extending (non-paralyzable)** | n_true = -ln(1 - n_obs × tau) / tau | Each new event during dead time restarts the dead period (e.g., pulse-shaping amplifier, retriggerable electronics) | | ||
| | **Generalized** | Numerical solution required | Real detectors are often intermediate between the two extremes | |
There was a problem hiding this comment.
Dead-time model names and formulas are mismatched.
The table currently pairs the non-extending/non-paralyzable model with the wrong label/formula narrative. This can cause users (or agents) to apply the wrong correction at high rates and bias results materially.
Please correct model naming and equations so non-paralyzable vs paralyzable behavior is unambiguous.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/gpd/specs/references/protocols/experimental-data-reduction.md` around
lines 73 - 75, The dead-time labels and formulas are swapped; update the table
so "Non-extending" is paired with "non-paralyzable" and the formula n_true =
n_obs / (1 - n_obs × tau), and "Extending" is paired with "paralyzable" with a
note that a numerical (or Lambert W) solution is required (e.g., n_true =
-W(-n_obs × tau)/tau) instead of the current -ln(...) expression; change the
text for the rows containing "Non-extending (paralyzable)" and "Extending
(non-paralyzable)" to "Non-extending (non-paralyzable)" and "Extending
(paralyzable)" and update the corresponding formula cells and the "Numerical
solution required" note for the paralyzable case.
| | Source | Affects | Type | Distribution | u_i (relative) | | ||
| |--------|---------|------|-------------|-----------------| | ||
| | 1. Absorbance repeatability | A | A | Gaussian (5 readings) | 0.48% | | ||
| | 2. Wavelength calibration | A (via ε(λ) slope) | B | Gaussian (certificate) | 0.20% | | ||
| | 3. Photometric accuracy | A | B | Rectangular (manufacturer) | 0.29% | | ||
| | 4. Detector nonlinearity | A | B | Rectangular (manufacturer) | 0.17% | | ||
| | 5. Stray light | A | B | Rectangular (manufacturer) | 0.15% | | ||
| | 6. Cuvette path length | l | B | Rectangular (manufacturer) | 0.058% | | ||
| | 7. Cuvette positioning reproducibility | l | A | Gaussian (10 repositionings) | 0.10% | | ||
| | 8. Solution concentration | c | B | Gaussian (gravimetric prep) | 0.50% | | ||
| | 9. Temperature coefficient of ε | ε | B | Rectangular (± 2 K × 0.1%/K) | 0.12% | | ||
| | 10. Blank subtraction (solvent absorbance) | A | A | Gaussian (3 blank readings) | 0.08% | | ||
|
|
||
| **Step 2: Quantification Details** | ||
|
|
||
| Source 1 (Repeatability): 5 readings: A = {0.624, 0.626, 0.623, 0.627, 0.625}. Mean = 0.625, s = 0.00158, u_1 = s/√5 = 0.00071 → 0.48/0.625 = 0.11% ... wait, let me recalculate: u_1/A = 0.00071/0.625 = 0.11%. But with t-factor for ν = 4: t_0.95 = 2.776, so this matters for coverage factor later. | ||
|
|
||
| Actually: u_1 = 0.00071 → relative = 0.114%. I listed 0.48% above using s rather than s/√N. Let me correct the table: | ||
|
|
||
| | Source | u_i (relative) | ν_i | | ||
| |--------|----------------|-----| | ||
| | 1. Absorbance repeatability | s/√5 = 0.114% | 4 | | ||
| | 2. Wavelength cal: certificate states U = ± 0.5 nm (k = 2), so u_λ = 0.25 nm. Near λ_max, dA/dλ ≈ 0. But measured at 520 nm, slope of spectrum gives dε/dλ ≈ −100 L/(mol·cm·nm) at the flank. If measuring exactly at peak, sensitivity is near zero. Assume we are at peak: c_2 × u_λ = 0.25 nm × |dε/dλ|/ε. At peak dε/dλ ≈ 0, so | 0.00% (at peak; up to 0.5% on flank) | ∞ | |
There was a problem hiding this comment.
Worked example contains contradictory uncertainty values before and after recalculation.
Line 479 lists Source 1 as 0.48%, then Line 494 corrects it to 0.114%. Keeping both versions in the canonical example makes extraction ambiguous for agents.
Keep only the corrected values in the final narrative/table, or clearly mark the earlier numbers as discarded draft values.
🧰 Tools
🪛 LanguageTool
[style] ~492-~492: To elevate your writing, try using an alternative expression here.
Context: ...ctor for ν = 4: t_0.95 = 2.776, so this matters for coverage factor later. Actually: u...
(MATTERS_RELEVANT)
🪛 markdownlint-cli2 (0.22.1)
[warning] 499-499: Table column count
Expected: 3; Actual: 5; Too many cells, extra data will be missing
(MD056, table-column-count)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/gpd/specs/references/protocols/instrument-systematic-budget.md` around
lines 477 - 499, The worked example shows conflicting values for Source 1
(Absorbance repeatability): keep only the corrected relative uncertainty (u_1 =
0.114%) throughout the document and remove or clearly mark as discarded the
earlier 0.48% draft value; specifically update the table row for "1. Absorbance
repeatability" to show 0.114% (and ν = 4), and edit the narrative lines that
recalculate u_1 (the paragraph referencing u_1/A and t-factor) so they present
the corrected computation only.
| | Source | u_i (relative) | ν_i | | ||
| |--------|----------------|-----| | ||
| | 1. Absorbance repeatability | s/√5 = 0.114% | 4 | | ||
| | 2. Wavelength cal: certificate states U = ± 0.5 nm (k = 2), so u_λ = 0.25 nm. Near λ_max, dA/dλ ≈ 0. But measured at 520 nm, slope of spectrum gives dε/dλ ≈ −100 L/(mol·cm·nm) at the flank. If measuring exactly at peak, sensitivity is near zero. Assume we are at peak: c_2 × u_λ = 0.25 nm × |dε/dλ|/ε. At peak dε/dλ ≈ 0, so | 0.00% (at peak; up to 0.5% on flank) | ∞ | |
There was a problem hiding this comment.
Malformed table row will render incorrectly (MD056).
Line 499 contains extra pipe delimiters in one cell, breaking column alignment and dropping content in some renderers.
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)
[warning] 499-499: Table column count
Expected: 3; Actual: 5; Too many cells, extra data will be missing
(MD056, table-column-count)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/gpd/specs/references/protocols/instrument-systematic-budget.md` at line
499, The Markdown table row beginning "2. Wavelength cal: certificate states U =
± 0.5 nm ..." is malformed due to extra pipe characters inside a cell ("| 0.00%
(at peak; up to 0.5% on flank) | ∞ |") which breaks column alignment; fix it by
removing or escaping the internal pipes so the row has the same number of
columns as the header (e.g., replace the inner pipes with escaped pipes or wrap
the cell in code/backticks, or reformat the cell content to "0.00% (at peak; up
to 0.5% on flank); ∞"), and verify the row now aligns with the table headers in
the file's table row that starts with "2. Wavelength cal".
| | E_n | Interpretation | | ||
| |-----|---------------| | ||
| | |E_n| <= 1.0 | Satisfactory — results agree within combined uncertainty | | ||
| | 1.0 < |E_n| <= 2.0 | Questionable — investigate possible systematics | | ||
| | |E_n| > 2.0 | Unsatisfactory — significant discrepancy requiring resolution | | ||
|
|
There was a problem hiding this comment.
Eₙ interpretation table is broken by unescaped | characters.
Rows like | |E_n| <= 1.0 | ... | create extra columns and render incorrectly. Escape pipes or wrap expressions in code spans.
Suggested fix
-| |E_n| <= 1.0 | Satisfactory — results agree within combined uncertainty |
-| 1.0 < |E_n| <= 2.0 | Questionable — investigate possible systematics |
-| |E_n| > 2.0 | Unsatisfactory — significant discrepancy requiring resolution |
+| \|E_n\| <= 1.0 | Satisfactory — results agree within combined uncertainty |
+| 1.0 < \|E_n\| <= 2.0 | Questionable — investigate possible systematics |
+| \|E_n\| > 2.0 | Unsatisfactory — significant discrepancy requiring resolution |🧰 Tools
🪛 markdownlint-cli2 (0.22.1)
[warning] 260-260: Table column count
Expected: 2; Actual: 4; Too many cells, extra data will be missing
(MD056, table-column-count)
[warning] 261-261: Table column count
Expected: 2; Actual: 4; Too many cells, extra data will be missing
(MD056, table-column-count)
[warning] 262-262: Table column count
Expected: 2; Actual: 4; Too many cells, extra data will be missing
(MD056, table-column-count)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/gpd/specs/references/protocols/measurement-reproducibility.md` around
lines 258 - 263, The Markdown table in the E_n interpretation block is broken
because literal pipe characters in the expressions (e.g. |E_n| <= 1.0) are being
parsed as column delimiters; update the E_n table rows in
measurement-reproducibility.md (the rows containing the |E_n| expressions) by
escaping the pipes or enclosing the expressions in code spans/backticks so the
table columns render correctly while preserving the intended math text.
|
🤖 RoastBot: "Experimental physics." In a tool with no laboratory. Bold. |
… tests - Rewrite gpd-lab-designer.md: 64K chars → 18K chars to fit within PHASE5_MAX_AGENT_EXPANDED_CHARS (36,500) budget - Add gpd-lab-designer to AGENT_BASELINES in test_agent_prompt_budget.py - Update PHASE5_MAX_TOTAL_AGENT_EXPANDED_CHARS: 363K → 381K for new agent - Add gpd-lab-designer to LIGHTWEIGHT_SHARED_PROTOCOL_AGENTS - Run sync_repo_graph_contract.py to update repo_graph_contract.json and tests/README.md scope counts (agents: 24→25, references: 241→244) - Add role_kits to agent frontmatter matching experiment-designer
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
tests/core/test_agent_prompt_budget.py (1)
85-89: ⚡ Quick winExtend boundary-contract assertions to include the new lab designer agent.
Since
gpd-lab-designeris now in the lightweight shared-protocol cohort, consider adding it to the concise boundary-reference contract test (test_agents_reference_infrastructure_for_shared_boundary_protocols_without_copying_them) to keep this new prompt under the same anti-copy guardrails.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/core/test_agent_prompt_budget.py` around lines 85 - 89, The concise boundary-reference contract test needs to include the new agent id "gpd-lab-designer": update the assertion in test_agents_reference_infrastructure_for_shared_boundary_protocols_without_copying_them to add "gpd-lab-designer" to the expected/shared-protocol agents list (where other ids like "gpd-literature-reviewer" and "gpd-planner" are asserted) so the test enforces the anti-copy guardrails for the new lightweight shared-protocol cohort.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@tests/core/test_agent_prompt_budget.py`:
- Around line 85-89: The concise boundary-reference contract test needs to
include the new agent id "gpd-lab-designer": update the assertion in
test_agents_reference_infrastructure_for_shared_boundary_protocols_without_copying_them
to add "gpd-lab-designer" to the expected/shared-protocol agents list (where
other ids like "gpd-literature-reviewer" and "gpd-planner" are asserted) so the
test enforces the anti-copy guardrails for the new lightweight shared-protocol
cohort.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: a64d8b8c-0564-4a54-9f20-5ed2dd724836
📒 Files selected for processing (4)
src/gpd/agents/gpd-lab-designer.mdtests/README.mdtests/core/test_agent_prompt_budget.pytests/repo_graph_contract.json
✅ Files skipped from review due to trivial changes (1)
- tests/repo_graph_contract.json
|
|
||
| - Classify each source as Type A (evaluated by statistical analysis of observations) or Type B (evaluated by other means: certificates, manufacturer specs, theoretical arguments). | ||
| - Assess correlations between sources; build correlation matrix if non-diagonal. | ||
| - Combine using GUM framework: u_c^2 = sum_i (c_i * u_i)^2 + 2 * sum_{i<j} c_i * c_j * u_i * u_j * r_ij. |
There was a problem hiding this comment.
Fix markdownlint violations in the updated prompt text.
Line 157 uses * in plain math text and Line 208 opens an unlabeled fenced block; both are currently flagged by markdownlint (MD037/MD040).
Proposed doc-only patch
-- Combine using GUM framework: u_c^2 = sum_i (c_i * u_i)^2 + 2 * sum_{i<j} c_i * c_j * u_i * u_j * r_ij.
+- Combine using GUM framework: `u_c^2 = sum_i (c_i * u_i)^2 + 2 * sum_{i<j} c_i * c_j * u_i * u_j * r_ij`.-```
+```md
> **For gpd-executor:** This file contains measurement specifications, calibration plans, and systematic budgets. Use these when executing laboratory tasks in this phase.</details>
Also applies to: 208-210
<details>
<summary>🧰 Tools</summary>
<details>
<summary>🪛 markdownlint-cli2 (0.22.1)</summary>
[warning] 157-157: Spaces inside emphasis markers
(MD037, no-space-in-emphasis)
---
[warning] 157-157: Spaces inside emphasis markers
(MD037, no-space-in-emphasis)
---
[warning] 157-157: Spaces inside emphasis markers
(MD037, no-space-in-emphasis)
---
[warning] 157-157: Spaces inside emphasis markers
(MD037, no-space-in-emphasis)
---
[warning] 157-157: Spaces inside emphasis markers
(MD037, no-space-in-emphasis)
---
[warning] 157-157: Spaces inside emphasis markers
(MD037, no-space-in-emphasis)
</details>
</details>
<!-- fingerprinting:phantom:triton:hawk -->
<!-- This is an auto-generated comment by CodeRabbit -->
Summary
GPD currently has no first-class support for physical/laboratory experiments — all 57 existing protocols and 24 verification checks target theoretical derivations and numerical simulations. The
gpd-experiment-designeragent is explicitly numerical-only. This PR adds the experimental physics foundation.New protocols (3 files, 1,625 lines total):
experimental-data-reduction.md— Dead time correction (extending/non-extending models), pile-up rejection, background estimation & subtraction (sideband, MC, analytical), efficiency/acceptance corrections, calibration application, systematic propagation through the correction chaininstrument-systematic-budget.md— GUM-compliant Type A/B uncertainty classification, calibration traceability chains, drift monitoring via control charts, budget combination with correlations, dominant source identificationmeasurement-reproducibility.md— Run-to-run stability via Allan variance, operator dependence testing, environmental sensitivity characterization, cross-apparatus agreement via E_n number (ISO 13528), blind analysis protocolsNew agent (1 file, 1,045 lines):
gpd-lab-designer.md— Designs physical measurement protocols, calibration plans, systematic uncertainty budgets, and reproducibility strategies. ProducesLAB-DESIGN.md(parallel to experiment-designer'sEXPERIMENT-DESIGN.md). Same authority model: coordination role, orchestrator commit, return_only state.Registry updates (5 files):
protocol-domains.json: new"experimental_methods"domain categoryconfig.py:MODEL_PROFILESentry for gpd-lab-designerregistry.py: category mapping for gpd-lab-designerset-profile.md: agent count 24 → 25test_config.py: agent count assertion updatedAll protocols follow established conventions: YAML frontmatter with
load_whentriggers, structured steps with tables and equations, common LLM error patterns (8 per protocol, 24 total), worked examples showing wrong-then-correct approaches, and verification checklists.Motivation
The experimental workflow gap is structural, not incidental. GPD assumes data arrives as static artifacts (CSV, published tables). Real experimental physics requires a pipeline from raw instrument data through corrections, calibration, and systematic budgeting. These protocols fill that gap and enable GPD to guide experimental data analysis with the same rigor it brings to derivations.
Test plan
test_registry.py+test_metadata_consistency.pytests passmain){GPD_INSTALL_DIR}placeholders correctly🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation
Tests