Course Lab Discussion Synthesis
Overview
Turn approved discussion directions into polished, confidence-aware, artifact-only discussion outputs for course-lab-final-staging.
This skill is standalone with local copied tools. It should read approved synthesis-input artifacts first, require caller-provided reference report paths, accept the canonical discussion_ideas handoff that course-lab-discussion-ideas emits, run one bounded web-enrichment pass on the first accepted-ideas run, allow targeted gap filling later only when the approved ideas are still not enough, and do not mutate main.tex.
Standalone Tool Contract
Use Independently When
- A caller has
discussion_synthesis_input.tmp.json from discussion-ideas or an approved equivalent bundle.
- Reference report paths are supplied by the caller and should ground synthesis support.
- The needed output is artifact-only discussion harmonization for later staging, not direct TeX mutation.
- Thinking-question, support-tag, and unresolved-evidence state need to be preserved into final-staging inputs.
- The run needs polished discussion artifacts before
course-lab-final-staging, and a reference_selection_status: none_found lane should stay an optional skip instead of a failed prerequisite.
Minimum Inputs
--experiment-name and --experiment-safe-name.
--synthesis-input-json that is approved or uses approval_mode: synthesis_judgment with a canonical discussion_ideas list.
- Existing caller-provided
--reference-report paths.
- Output paths for
discussion_synthesis.json, discussion_synthesis.md, discussion_synthesis_unresolved.md, discussion_staging_input.tmp.json, and discussion_staging_input.tmp.md.
Optional Workflow Inputs
--synthesis-input-markdown for human-readable context.
--results-interpretation-json and --results-interpretation-markdown for data-backed grounding.
--prior-synthesis-json to distinguish first accepted-ideas enrichment from later targeted gap filling.
- Upstream thinking-question prompts and evidence tags from
course-lab-discussion-ideas.
Procedure
- Use only local scripts in
/root/.codex/skills/course-lab-discussion-synthesis/scripts/.
- Validate that input is approved or a valid
synthesis_judgment handoff before writing synthesis artifacts.
- Preserve evidence labels such as
handout-backed, reference-backed, data-backed, generic/speculative, and unresolved from the idea handoff when deciding wording posture.
- Convert thinking-question prompts into explicit discussion blocks or unresolved notes rather than dropping them.
- Run only one bounded enrichment pass on the first accepted-ideas run; later reruns use targeted gap fill only when weak support remains.
Outputs
discussion_synthesis.json and discussion_synthesis.md with polished, support-aware discussion blocks.
discussion_synthesis_unresolved.md preserving weak support, missing evidence tags, unanswerable thinking questions, or unresolved data-lack notes.
discussion_staging_input.tmp.json and .md for final staging, including support strength, source references, approved idea IDs, and any unresolved constraints.
Validation
- Every synthesized block traces to an approved idea or valid synthesis-judgment item.
- Low-confidence, generic/speculative, or unresolved support remains visibly cautious.
- Thinking-question outputs are either represented in a discussion block or explicitly listed as unresolved.
- No direct mutation of
main.tex occurs.
- Local discussion-synthesis tests pass.
Failure / Reroute Signals
- Missing or malformed synthesis input: stop in standalone mode and request a valid discussion-ideas handoff; in full-report mode, reroute to discussion ideas.
- Missing reference reports: stop and request caller-provided reference paths rather than inventing support.
- Weak approved ideas after enrichment: emit cautious wording plus unresolved notes; do not create new major directions without approval.
- Missing data-backed support: keep a visible
data-backed gap or unresolved/data-lack note instead of smoothing it over.
Non-Ownership
- This tool does not generate initial ideas, approve major directions, discover references, mutate
main.tex, perform final staging, or run final QC.
- This tool does not hide weak support just to make final-staging input look complete.
- This tool does not require a full-workflow controller or native agent file for standalone use.
Optional Workflow Metadata
- Suggested future role label:
discussioner.
- Typical upstream tools:
course-lab-discussion-ideas, caller-provided reference selection, optional results interpretation.
- Typical downstream tools:
course-lab-final-staging, then course-lab-finalize-qc.
Workflow Notes
- Use local
/root/.codex/skills/course-lab-discussion-synthesis/scripts/build_discussion_synthesis.py as the main synthesis entrypoint.
- Keep runtime dependencies local to
/root/.codex/skills/course-lab-discussion-synthesis/.
- Treat synthesis-input JSON as required.
- Accept
discussion_ideas as the canonical pre-synthesis list.
- Accept
approval_mode: synthesis_judgment when the input came directly from course-lab-discussion-ideas.
- Treat caller-provided reference report paths as required.
- Perform one bounded first accepted-ideas web-enrichment pass on the first synthesis run.
- Skip repeated broad browsing on reruns unless the approved ideas are still weak enough to justify targeted gap fill.
- Emit artifact-only outputs:
discussion_synthesis.json
discussion_synthesis.md
discussion_synthesis_unresolved.md
discussion_staging_input.tmp.json
discussion_staging_input.tmp.md
Primary Command
python3 /root/.codex/skills/course-lab-discussion-synthesis/scripts/build_discussion_synthesis.py \
--experiment-name "Mechanics Combined" \
--experiment-safe-name "mechanics_combined_english" \
--synthesis-input-json "/path/to/results/<experiment>/discussion_synthesis_input.tmp.json" \
--synthesis-input-markdown "/path/to/results/<experiment>/discussion_synthesis_input.tmp.md" \
--reference-report "/path/to/reference_report_a.json" \
--reference-report "/path/to/reference_report_b.json" \
--results-interpretation-json "/path/to/results/<experiment>/results_interpretation.json" \
--prior-synthesis-json "/path/to/results/<experiment>/discussion_synthesis.json" \
--output-json "/path/to/results/<experiment>/discussion_synthesis.json" \
--output-markdown "/path/to/results/<experiment>/discussion_synthesis.md" \
--output-unresolved "/path/to/results/<experiment>/discussion_synthesis_unresolved.md" \
--output-staging-json "/path/to/results/<experiment>/discussion_staging_input.tmp.json" \
--output-staging-markdown "/path/to/results/<experiment>/discussion_staging_input.tmp.md"
Workflow
- Confirm that synthesis-input artifacts already exist.
- Read the synthesis-input JSON first and fail clearly if it is neither approved nor a valid
synthesis_judgment handoff with discussion_ideas.
- Read the caller-provided reference report artifacts.
- Read optional results-interpretation artifacts when they exist so synthesis stays grounded in experiment evidence.
- Decide whether this is the first accepted-ideas synthesis run.
- On the first accepted-ideas run, record one bounded broad enrichment pass.
- On later runs, use targeted gap fill only when approved ideas remain weak.
- Emit artifact-only JSON and Markdown outputs for
course-lab-final-staging.
- Keep unresolved support gaps visible instead of writing overconfident prose.
Boundary Rules
- This skill is artifact-only.
- This skill requires approved discussion inputs or a valid
synthesis_judgment handoff from course-lab-discussion-ideas.
- This skill requires caller-provided reference report inputs.
- This skill does not mutate the report.
- This skill does not write directly into
main.tex.
- This skill does not invent new unapproved major discussion directions during research.
- This skill does not perform final staging or final QC.
Common Mistakes
- Treating malformed
synthesis_judgment input without discussion_ideas as acceptable synthesis input.
- Treating reference reports as optional.
- Repeating broad browsing on later reruns.
- Hiding weak support instead of surfacing it in unresolved output.
- Reaching back into sibling skill folders instead of using the local copied scripts.
1---2name: course-lab-discussion-synthesis3description: Use when a course lab-report run already has approved discussion-idea handoff artifacts plus matched reference reports and now needs artifact-only discussion harmonization for course-lab-final-staging.4---56# Course Lab Discussion Synthesis78## Overview910Turn approved discussion directions into polished, confidence-aware, artifact-only discussion outputs for `course-lab-final-staging`.1112This skill is standalone with local copied tools. It should read approved synthesis-input artifacts first, require caller-provided reference report paths, accept the canonical `discussion_ideas` handoff that `course-lab-discussion-ideas` emits, run one bounded web-enrichment pass on the first accepted-ideas run, allow targeted gap filling later only when the approved ideas are still not enough, and do not mutate `main.tex`.1314## Standalone Tool Contract1516### Use Independently When1718- A caller has `discussion_synthesis_input.tmp.json` from discussion-ideas or an approved equivalent bundle.19- Reference report paths are supplied by the caller and should ground synthesis support.20- The needed output is artifact-only discussion harmonization for later staging, not direct TeX mutation.21- Thinking-question, support-tag, and unresolved-evidence state need to be preserved into final-staging inputs.22- The run needs polished discussion artifacts before `course-lab-final-staging`, and a `reference_selection_status: none_found` lane should stay an optional skip instead of a failed prerequisite.2324### Minimum Inputs2526- `--experiment-name` and `--experiment-safe-name`.27- `--synthesis-input-json` that is approved or uses `approval_mode: synthesis_judgment` with a canonical `discussion_ideas` list.28- Existing caller-provided `--reference-report` paths.29- Output paths for `discussion_synthesis.json`, `discussion_synthesis.md`, `discussion_synthesis_unresolved.md`, `discussion_staging_input.tmp.json`, and `discussion_staging_input.tmp.md`.3031### Optional Workflow Inputs3233- `--synthesis-input-markdown` for human-readable context.34- `--results-interpretation-json` and `--results-interpretation-markdown` for data-backed grounding.35- `--prior-synthesis-json` to distinguish first accepted-ideas enrichment from later targeted gap filling.36- Upstream thinking-question prompts and evidence tags from `course-lab-discussion-ideas`.3738### Procedure3940- Use only local scripts in `/root/.codex/skills/course-lab-discussion-synthesis/scripts/`.41- Validate that input is approved or a valid `synthesis_judgment` handoff before writing synthesis artifacts.42- Preserve evidence labels such as `handout-backed`, `reference-backed`, `data-backed`, `generic/speculative`, and `unresolved` from the idea handoff when deciding wording posture.43- Convert thinking-question prompts into explicit discussion blocks or unresolved notes rather than dropping them.44- Run only one bounded enrichment pass on the first accepted-ideas run; later reruns use targeted gap fill only when weak support remains.4546### Outputs4748- `discussion_synthesis.json` and `discussion_synthesis.md` with polished, support-aware discussion blocks.49- `discussion_synthesis_unresolved.md` preserving weak support, missing evidence tags, unanswerable thinking questions, or unresolved data-lack notes.50- `discussion_staging_input.tmp.json` and `.md` for final staging, including support strength, source references, approved idea IDs, and any unresolved constraints.5152### Validation5354- Every synthesized block traces to an approved idea or valid synthesis-judgment item.55- Low-confidence, generic/speculative, or unresolved support remains visibly cautious.56- Thinking-question outputs are either represented in a discussion block or explicitly listed as unresolved.57- No direct mutation of `main.tex` occurs.58- Local discussion-synthesis tests pass.5960### Failure / Reroute Signals6162- Missing or malformed synthesis input: stop in standalone mode and request a valid discussion-ideas handoff; in full-report mode, reroute to discussion ideas.63- Missing reference reports: stop and request caller-provided reference paths rather than inventing support.64- Weak approved ideas after enrichment: emit cautious wording plus unresolved notes; do not create new major directions without approval.65- Missing data-backed support: keep a visible `data-backed` gap or unresolved/data-lack note instead of smoothing it over.6667### Non-Ownership6869- This tool does not generate initial ideas, approve major directions, discover references, mutate `main.tex`, perform final staging, or run final QC.70- This tool does not hide weak support just to make final-staging input look complete.71- This tool does not require a full-workflow controller or native agent file for standalone use.7273## Optional Workflow Metadata7475- Suggested future role label: `discussioner`.76- Typical upstream tools: `course-lab-discussion-ideas`, caller-provided reference selection, optional results interpretation.77- Typical downstream tools: `course-lab-final-staging`, then `course-lab-finalize-qc`.7879## Workflow Notes8081- Use local `/root/.codex/skills/course-lab-discussion-synthesis/scripts/build_discussion_synthesis.py` as the main synthesis entrypoint.82- Keep runtime dependencies local to `/root/.codex/skills/course-lab-discussion-synthesis/`.83- Treat synthesis-input JSON as required.84- Accept `discussion_ideas` as the canonical pre-synthesis list.85- Accept `approval_mode: synthesis_judgment` when the input came directly from `course-lab-discussion-ideas`.86- Treat caller-provided reference report paths as required.87- Perform one bounded first accepted-ideas web-enrichment pass on the first synthesis run.88- Skip repeated broad browsing on reruns unless the approved ideas are still weak enough to justify targeted gap fill.89- Emit artifact-only outputs:90 - `discussion_synthesis.json`91 - `discussion_synthesis.md`92 - `discussion_synthesis_unresolved.md`93 - `discussion_staging_input.tmp.json`94 - `discussion_staging_input.tmp.md`9596## Primary Command9798```bash99python3 /root/.codex/skills/course-lab-discussion-synthesis/scripts/build_discussion_synthesis.py \100 --experiment-name "Mechanics Combined" \101 --experiment-safe-name "mechanics_combined_english" \102 --synthesis-input-json "/path/to/results/<experiment>/discussion_synthesis_input.tmp.json" \103 --synthesis-input-markdown "/path/to/results/<experiment>/discussion_synthesis_input.tmp.md" \104 --reference-report "/path/to/reference_report_a.json" \105 --reference-report "/path/to/reference_report_b.json" \106 --results-interpretation-json "/path/to/results/<experiment>/results_interpretation.json" \107 --prior-synthesis-json "/path/to/results/<experiment>/discussion_synthesis.json" \108 --output-json "/path/to/results/<experiment>/discussion_synthesis.json" \109 --output-markdown "/path/to/results/<experiment>/discussion_synthesis.md" \110 --output-unresolved "/path/to/results/<experiment>/discussion_synthesis_unresolved.md" \111 --output-staging-json "/path/to/results/<experiment>/discussion_staging_input.tmp.json" \112 --output-staging-markdown "/path/to/results/<experiment>/discussion_staging_input.tmp.md"113```114115## Workflow1161171. Confirm that synthesis-input artifacts already exist.1182. Read the synthesis-input JSON first and fail clearly if it is neither approved nor a valid `synthesis_judgment` handoff with `discussion_ideas`.1193. Read the caller-provided reference report artifacts.1204. Read optional results-interpretation artifacts when they exist so synthesis stays grounded in experiment evidence.1215. Decide whether this is the first accepted-ideas synthesis run.1226. On the first accepted-ideas run, record one bounded broad enrichment pass.1237. On later runs, use targeted gap fill only when approved ideas remain weak.1248. Emit artifact-only JSON and Markdown outputs for `course-lab-final-staging`.1259. Keep unresolved support gaps visible instead of writing overconfident prose.126127## Boundary Rules128129- This skill is artifact-only.130- This skill requires approved discussion inputs or a valid `synthesis_judgment` handoff from `course-lab-discussion-ideas`.131- This skill requires caller-provided reference report inputs.132- This skill does not mutate the report.133- This skill does not write directly into `main.tex`.134- This skill does not invent new unapproved major discussion directions during research.135- This skill does not perform final staging or final QC.136137## Common Mistakes138139- Treating malformed `synthesis_judgment` input without `discussion_ideas` as acceptable synthesis input.140- Treating reference reports as optional.141- Repeating broad browsing on later reruns.142- Hiding weak support instead of surfacing it in unresolved output.143- Reaching back into sibling skill folders instead of using the local copied scripts.