Skip to content

Conversation

xinyinghou
Copy link
Contributor

@xinyinghou xinyinghou commented Aug 24, 2025

This PR introduces a Runestone-specific CodeTailor version (codetailor-runestone-ver) based on the latest upstream main branch.

Note:

  • This is an initial attempt, expect follow-ups and discussions.
  • PR 28 in overview book added questions for dev testing.
  • Additional packages are added in pyproject.toml

Runestone-specific version:

  • Added CodeTailor modules under book_server_api
    • coach.py
      • In dev mode: coach.py will require a DEV_API key for testing.
      • In production: coach.py will use an instructor-provided API key via fetch_api_token (real service).
      • Can link to instructor-provided Parsons example, this testing blocked in dev mode since question DB isn’t available.
    • personalize_parsons
      • Enable LLM to supply an example solution when no predefined one exists.
      • Remove LLM generation time limit to reduce serving with guardrails
      • Add paired distractors for both two personalization levels
      • Use zero-shot prompting so no extra information is needed
  • Added CodeTailor modules under activecode component
    • Only keep two additional specs:
      • :parsonspersonalize: moveable or partial (required)
      • :parsonsexample: id of an existing Parsons problem (optional)
  • Added CodeTailor modules under parsons component
    • Added new files for block-level personalization
    • Included an automatically-added spec :scaffolding: to separate scaffolding puzzle code

@xinyinghou xinyinghou requested a review from bnmnetp as a code owner August 24, 2025 21:15
@xinyinghou xinyinghou changed the title Prepare Runestone-specific CodeTailor version (initial attempt) Prepare a Runestone CodeTailor version optimized for production (initial attempt) Aug 24, 2025
Copy link
Member

@bnmnetp bnmnetp left a comment

Choose a reason for hiding this comment

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

OK, the good news.

  1. It does not appear as though your changes break anything about current activecode or parsons problems

However I can't test any further.

  1. Please structure your changes to the overview book like a chapter so that it appears in the table of contents.
  2. the book server crashes when I finally figured out how to navigate my wat to the samples. It is missing the openai and I'm guessing javlang modules
  3. You should be able to fully test this in a working docker environment. When you have done that please submit your updates.

The documentation for build and running and rebuilding containers is all on https://runestone-monorepo.readthedocs.io/en/latest/

@@ -126,6 +126,9 @@ runestone = { path = "./projects/interactives", develop = true }
rsmanage = { path = "./projects/rsmanage", develop = true }
json2xml = "^3.21.0"
pytest-asyncio = "^0.24.0"
openai = "^1.59.3"
Copy link
Member

Choose a reason for hiding this comment

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

It is good to have these here, but they also need to be added to the pyproject.toml file in the book project.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, are those the two places to add the new packages? Or is there more places I need to include these two new packages?

Copy link
Member

Choose a reason for hiding this comment

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

Any of the servers that need those libraries need to be updated. I think it is just the book server that you are using to interface to openai.

Copy link
Member

Choose a reason for hiding this comment

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

I also noticed that when it crashed the book server the web page spinner just kept spinning and giving me encouraging messages. You should detect a failure and give an appropriate message to the user.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I only require them in the book server. I am adding it to the pyproject.toml there

Copy link
Contributor Author

@xinyinghou xinyinghou Aug 29, 2025

Choose a reason for hiding this comment

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

Okay, I will change it to an error message to the user. I am setting it as either resolve when the backend responds, or reject and send an error message if it takes longer than 1 minute.

@bnmnetp
Copy link
Member

bnmnetp commented Aug 29, 2025

Add a comment to keep @barbarer in the loop.

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.

2 participants