Skip to content

Fix correction import schema and update dependencies#290

Merged
DickHorner merged 15 commits into
release/livefrom
main
May 27, 2026
Merged

Fix correction import schema and update dependencies#290
DickHorner merged 15 commits into
release/livefrom
main

Conversation

@DickHorner
Copy link
Copy Markdown
Owner

This pull request introduces several improvements and fixes across the codebase, with a focus on enhancing the exams correction import/export workflow, updating dependencies, and clarifying documentation for multi-bundle correction exports. The most significant changes include support for batch importing correction bundles, clearer prompt and contract templates for multi-bundle exports, and dependency updates for security and compatibility.

Exams Correction Import/Export Improvements:

  • Added support for batch importing correction bundles via a new executeMany method in ImportKbrCorrectionBundleUseCase and corresponding input/output types. This allows importing multiple bundles in a single operation, improving efficiency and consistency. (modules/exams/src/use-cases/import-kbr-correction-bundle.use-case.ts, apps/teacher-ui/src/composables/useExamsBridge.ts, [1] [2] [3] [4]
  • Added a test for batch import functionality to ensure correct behavior when importing multiple correction bundles. (modules/exams/tests/import-kbr-correction-bundle-batch.use-case.test.ts, modules/exams/tests/import-kbr-correction-bundle-batch.use-case.test.tsR1-R172)

Prompt and Contract Template Clarifications:

  • Updated prompt and contract templates to clarify that the Ende Korrektur command must export a JSON array of import bundles (one per resolved Leistung), not a single object or wrapper. Added stricter requirements for output format and included the import bundle schema in the prompt for better guidance. (modules/exams/rule-packs/default/contract.template.md, modules/exams/rule-packs/default/prompt.template.md, modules/exams/src/rule-packs/default-pack.ts, modules/exams/src/use-cases/export-correction-session.use-case.ts, [1] [2] [3] [4] [5] [6] [7] [8] [9]
  • Enhanced related tests to verify the presence of new schema and instructions in generated prompt artifacts. (modules/exams/tests/export-correction-session.use-case.test.ts, modules/exams/tests/export-correction-session.use-case.test.tsR211-R217)

Dependency Updates:

  • Updated various dependencies and devDependencies for security, bug fixes, and compatibility, including @types/node, better-sqlite3, vite, vue-i18n, vue-router, and others across multiple package.json files. [1] [2] [3] [4] [5] [6] [7]## Summary

Linked issue(s)

  • Closes #
  • Related to #

Checklist

  • Scope is focused and intentional
  • At least one non-author human review approval (or emergency hotfix rationale documented)
  • Docs updated (README/docs/roadmap) where needed
  • npm run lint:docs passes
  • npm run typecheck passes
  • npm run test passes
  • npm run build passes

Testing evidence

Architecture and risk notes

  • Module boundaries preserved (apps -> modules -> packages)
  • No hidden breaking changes
  • Local-first / iPadOS Safari behavior considered

Module proposal impact (if applicable)

  • Subject:
  • School form:
  • New module/plugin contracts affected:

Screenshots / recordings (if UI change)

DickHorner and others added 15 commits May 22, 2026 14:41
Bumps the npm-production group with 3 updates: [better-sqlite3](https://github.com/WiseLibs/better-sqlite3), [vue-i18n](https://github.com/intlify/vue-i18n/tree/HEAD/packages/vue-i18n) and [vue-router](https://github.com/vuejs/router).


Updates `better-sqlite3` from 12.9.0 to 12.10.0
- [Release notes](https://github.com/WiseLibs/better-sqlite3/releases)
- [Commits](WiseLibs/better-sqlite3@v12.9.0...v12.10.0)

Updates `vue-i18n` from 11.4.2 to 11.4.4
- [Release notes](https://github.com/intlify/vue-i18n/releases)
- [Changelog](https://github.com/intlify/vue-i18n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/intlify/vue-i18n/commits/v11.4.4/packages/vue-i18n)

Updates `vue-router` from 5.0.6 to 5.0.7
- [Release notes](https://github.com/vuejs/router/releases)
- [Commits](vuejs/router@v5.0.6...v5.0.7)

---
updated-dependencies:
- dependency-name: better-sqlite3
  dependency-version: 12.10.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: npm-production
- dependency-name: vue-i18n
  dependency-version: 11.4.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-production
- dependency-name: vue-router
  dependency-version: 5.0.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-production
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps the npm-development group with 4 updates: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node), [@vitejs/plugin-vue](https://github.com/vitejs/vite-plugin-vue/tree/HEAD/packages/plugin-vue), [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) and [vue-tsc](https://github.com/vuejs/language-tools/tree/HEAD/packages/tsc).


Updates `@types/node` from 25.7.0 to 25.9.0
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Updates `@vitejs/plugin-vue` from 6.0.6 to 6.0.7
- [Release notes](https://github.com/vitejs/vite-plugin-vue/releases)
- [Changelog](https://github.com/vitejs/vite-plugin-vue/blob/main/packages/plugin-vue/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite-plugin-vue/commits/plugin-vue@6.0.7/packages/plugin-vue)

Updates `vite` from 8.0.12 to 8.0.13
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v8.0.13/packages/vite)

Updates `vue-tsc` from 3.2.9 to 3.3.0
- [Release notes](https://github.com/vuejs/language-tools/releases)
- [Changelog](https://github.com/vuejs/language-tools/blob/master/CHANGELOG.md)
- [Commits](https://github.com/vuejs/language-tools/commits/v3.3.0/packages/tsc)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 25.9.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-development
- dependency-name: "@vitejs/plugin-vue"
  dependency-version: 6.0.7
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-development
- dependency-name: vite
  dependency-version: 8.0.13
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-development
- dependency-name: vue-tsc
  dependency-version: 3.3.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-development
...

Signed-off-by: dependabot[bot] <support@github.com>
…roduction-dc5a7c37a3

chore(deps): bump the npm-production group with 3 updates
…evelopment-b8bad99843

chore(deps-dev): bump the npm-development group with 4 updates
…contract

Include correction import schema in ChatGPT export prompt
@github-advanced-security
Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@DickHorner DickHorner merged commit c9dd014 into release/live May 27, 2026
8 of 9 checks passed
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

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 introduces support for batch importing correction bundles by adding a new executeMany method to the ImportKbrCorrectionBundleUseCase and updating the exams bridge composable to handle arrays of bundles. It also updates the default rule pack prompt templates to specify that Ende Korrektur should return a JSON array of import bundles, and includes corresponding unit tests. The review comments point out opportunities to clean up payload objects by destructuring unused properties (such as removing the redundant bundle or bundles array when forwarding inputs) and raise a critical architectural consideration regarding transaction handling and partial failures during sequential batch imports.

Comment on lines +213 to +222
importCorrectionBundle: (input) => {
if (Array.isArray(input.bundle)) {
return importKbrCorrectionBundleUseCase.executeMany({
...input,
bundles: input.bundle
});
}

return importKbrCorrectionBundleUseCase.execute(input);
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

When input.bundle is an array, spreading input directly into executeMany means the duplicate bundle property (which is the array) is still passed along with the new bundles property. Destructuring bundle out of input first keeps the payload clean and avoids passing redundant properties.

Suggested change
importCorrectionBundle: (input) => {
if (Array.isArray(input.bundle)) {
return importKbrCorrectionBundleUseCase.executeMany({
...input,
bundles: input.bundle
});
}
return importKbrCorrectionBundleUseCase.execute(input);
},
importCorrectionBundle: (input) => {
if (Array.isArray(input.bundle)) {
const { bundle, ...rest } = input;
return importKbrCorrectionBundleUseCase.executeMany({
...rest,
bundles: bundle
});
}
return importKbrCorrectionBundleUseCase.execute(input);
},

Comment on lines +224 to +238
async executeMany(input: ImportKbrCorrectionBundleBatchInput): Promise<ImportKbrCorrectionBundleBatchResult> {
const results: ImportKbrCorrectionBundleResult[] = [];

for (const bundle of input.bundles) {
results.push(await this.execute({ ...input, bundle }));
}

return {
results,
importedBundleCount: results.length,
importedTaskScoreCount: results.reduce((sum, result) => sum + result.importedTaskScoreCount, 0),
skippedTaskScoreCount: results.reduce((sum, result) => sum + result.skippedTaskScoreCount, 0),
uncertainties: results.flatMap((result) => result.uncertainties)
};
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Spreading input directly into this.execute passes the entire bundles array to each individual execute call as an extra property, which is unnecessary and can be avoided by destructuring bundles first.

Additionally, since this method processes multiple bundles sequentially using await in a loop, any error thrown by a single bundle (e.g., validation failure or database error) will abort the entire batch import midway. This can leave the database in a partially imported state. Consider wrapping the batch execution in a database transaction if atomicity is required, or catching errors per bundle to allow successful ones to complete while returning a list of failed imports.

Suggested change
async executeMany(input: ImportKbrCorrectionBundleBatchInput): Promise<ImportKbrCorrectionBundleBatchResult> {
const results: ImportKbrCorrectionBundleResult[] = [];
for (const bundle of input.bundles) {
results.push(await this.execute({ ...input, bundle }));
}
return {
results,
importedBundleCount: results.length,
importedTaskScoreCount: results.reduce((sum, result) => sum + result.importedTaskScoreCount, 0),
skippedTaskScoreCount: results.reduce((sum, result) => sum + result.skippedTaskScoreCount, 0),
uncertainties: results.flatMap((result) => result.uncertainties)
};
}
async executeMany(input: ImportKbrCorrectionBundleBatchInput): Promise<ImportKbrCorrectionBundleBatchResult> {
const { bundles, ...rest } = input;
const results: ImportKbrCorrectionBundleResult[] = [];
for (const bundle of bundles) {
results.push(await this.execute({ ...rest, bundle }));
}
return {
results,
importedBundleCount: results.length,
importedTaskScoreCount: results.reduce((sum, result) => sum + result.importedTaskScoreCount, 0),
skippedTaskScoreCount: results.reduce((sum, result) => sum + result.skippedTaskScoreCount, 0),
uncertainties: results.flatMap((result) => result.uncertainties)
};
}

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