Skip to content

Initial Conductor Migration (Repeat Module Migration, Testing, Documentation)#698

Open
AaravMalani wants to merge 4 commits into
conductor-migrationfrom
feat/initial-migration
Open

Initial Conductor Migration (Repeat Module Migration, Testing, Documentation)#698
AaravMalani wants to merge 4 commits into
conductor-migrationfrom
feat/initial-migration

Conversation

@AaravMalani

@AaravMalani AaravMalani commented Jun 9, 2026

Copy link
Copy Markdown
Member

Description

This PR kickstarts the initial migration of the modules to the Conductor framework. It

  • ports the Repeat module to support the language and evaluator agnostic Conductor module interface.
  • implements Typedoc reflection mappings to properly convert the new module plugin into the original documentation format
  • creates a common testing plugin (@sourceacademy/modules-testplugin) for Conductor testing utilities (including a sample native evaluator)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.

  • Running yarn build:libs && yarn build:docs and verifying that the documentation has been unaffected
  • Unit tests for src/bundles/repeat
  • Unit tests for lib/testplugin
  • Unit tests for lib/buildtools/src/build/docs/conductor.ts

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@AaravMalani AaravMalani requested a review from leeyi45 June 9, 2026 09:05

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request migrates the repeat bundle to use Conductor types and introduces a new testplugin package with an in-memory TestDataHandler for testing. It also adds documentation normalization tools to map Conductor implementation details to the public API surface. Feedback on these changes includes lifting recursive closure creation out of the generator in repeat to improve performance, adding optional chaining to prevent a potential TypeError in the documentation builder, cloning initial array values in TestDataHandler to avoid shared-state mutations, and implementing cycle detection in list_to_vec to prevent infinite loops.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/bundles/repeat/src/functions.ts
Comment thread lib/buildtools/src/build/docs/conductor.ts Outdated
Comment thread lib/testplugin/src/index.ts
Comment thread lib/testplugin/src/index.ts
@leeyi45

leeyi45 commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Just for some general queries: was it difficult to figure out how the repository worked? Was understanding/modifying the buildtools difficult?

Comment thread lib/testplugin/src/index.ts

describe(normalizeConductorType, () => {
it('maps TypedValue numbers to native numbers', () => {
const project = createProject();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If project needs to be created every single time, would it be better to provide it as a test fixture?

@AaravMalani AaravMalani Jun 10, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'd never heard of test fixtures before this. Now that I've done my research, if you mean test.extend, then agreed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think the file can afford to be split up, but otherwise thanks for taking the time to write the docstrings

@AaravMalani

Copy link
Copy Markdown
Member Author

Just for some general queries: was it difficult to figure out how the repository worked? Was understanding/modifying the buildtools difficult?

I've already been lingering on the modules repository for a while, so I knew the basic structure pretty well. Even then, it was pretty well laid out.

Finding the JSON and HTML building step for buildtools was pretty quick tracing the function calls. Since I only changed a couple of lines in the current buildtools, it was pretty simple for me

I'm giving an AI disclosure right now that Codex worked on the conductor.ts and conductor.test.ts file, but the rest was by hand. Nevertheless, it was definitely an easy to understand structure

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