Skip to content

Add PR-triggered chapter review workflow and agent instruction set for PDF↔notebook quality gates#1

Merged
ChrisJones79 merged 8 commits into
mainfrom
copilot/create-workflow-for-agents
Jun 9, 2026
Merged

Add PR-triggered chapter review workflow and agent instruction set for PDF↔notebook quality gates#1
ChrisJones79 merged 8 commits into
mainfrom
copilot/create-workflow-for-agents

Conversation

Copilot AI commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

This PR introduces a PR-driven multi-agent workflow for chapter development in NLPDE/, centered on strict chapter PDF ↔ notebook pairing and iterative agent feedback before human review. It also defines reusable agent instructions and shared-context guidance for consistent chapter evaluation.

  • Workflow orchestration (.github/workflows/chapter-pr-agent-cycle.yml)

    • Triggers on PR updates touching chapter content or agent/workflow config.
    • Enforces exactly one changed chapter PDF and one changed notebook per PR, with identical base names.
    • Handles config-only updates gracefully by skipping chapter review jobs instead of failing.
    • Stages review flow into: content coverage review, interactivity review, then author revision-loop guidance.
  • Agent contracts (.github/agent-instructions/*)

    • content-coverage-agent.md: requires chapter-to-notebook concept mapping; flags missing/insufficient coverage (not relevant extras).
    • interactivity-agent.md: prioritizes high-impact visualization/interactivity opportunities tied to chapter learning goals.
    • chapter-author-agent.md: defines iterative author behavior—submit chapter PR, incorporate agent feedback, repeat until both agent concerns are resolved.
  • Process documentation (docs/agent-workflow.md)

    • Documents end-to-end PR loop and review responsibilities.
    • Specifies 1:1 filename rule semantics (exact pre-extension match).
    • Recommends one-time PDF preprocessing + shared vector store retrieval for multi-agent consistency and citation quality.
# Chapter pairing gate (excerpt)
if [[ ${#PDF_FILES[@]} -ne 1 || ${#IPYNB_FILES[@]} -ne 1 ]]; then
  echo "Expected exactly one chapter PDF and one notebook update per PR."
  exit 1
fi

PDF_BASE="$(basename "$PDF" .pdf)"
IPYNB_BASE="$(basename "$IPYNB" .ipynb)"
if [[ "$PDF_BASE" != "$IPYNB_BASE" ]]; then
  echo "Use matching base names, for example: NLPDE_Ch2.pdf and NLPDE_Ch2.ipynb"
  exit 1
fi

@ChrisJones79 ChrisJones79 marked this pull request as ready for review June 9, 2026 10:36
Copilot AI review requested due to automatic review settings June 9, 2026 10:36
@ChrisJones79 ChrisJones79 merged commit f8f2bd7 into main Jun 9, 2026
1 check passed
@ChrisJones79 ChrisJones79 deleted the copilot/create-workflow-for-agents branch June 9, 2026 10:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a PR-triggered GitHub Actions workflow and supporting documentation/instructions to enforce strict chapter PDF ↔ notebook pairing in NLPDE/ and to structure a multi-stage (coverage → interactivity → author loop) review cycle before human review.

Changes:

  • Introduces a pull_request workflow that detects changed chapter assets and enforces a 1:1 PDF↔notebook base-name pairing gate.
  • Adds reusable agent instruction “contracts” for content coverage, interactivity, and author revision-loop guidance.
  • Documents the end-to-end PR workflow and recommends shared preprocessing for consistent multi-agent context.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
.github/workflows/chapter-pr-agent-cycle.yml Adds PR workflow orchestration, pairing gate, and staged (placeholder) agent jobs.
.github/agent-instructions/content-coverage-agent.md Defines coverage agent mission/rules and PR-comment output format.
.github/agent-instructions/interactivity-agent.md Defines interactivity agent mission/rules and PR-comment output format.
.github/agent-instructions/chapter-author-agent.md Defines author agent workflow and completion gate criteria.
docs/agent-workflow.md Documents the workflow behavior and recommended shared preprocessing pattern.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +44 to +56
DIFF_OUTPUT="$(git diff --name-only "$BASE_SHA" "$HEAD_SHA" -- NLPDE)" || {
echo "Failed to compute NLPDE file diff for base=$BASE_SHA head=$HEAD_SHA."
exit 1
}
mapfile -t CHANGED <<< "$DIFF_OUTPUT"

if [[ ${#CHANGED[@]} -eq 0 ]]; then
echo "No files changed in NLPDE/. Workflow triggered by agent instruction or workflow updates only."
echo "skip_review=true" >> "$GITHUB_OUTPUT"
echo "chapter_pdf=" >> "$GITHUB_OUTPUT"
echo "chapter_notebook=" >> "$GITHUB_OUTPUT"
exit 0
fi
Comment on lines +11 to +13
permissions:
contents: read
pull-requests: write
Comment thread docs/agent-workflow.md
## PR trigger
Workflow file: `.github/workflows/chapter-pr-agent-cycle.yml`

On PR updates affecting `NLPDE/**`, the workflow:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants