feat(moodle): add source-broker obligation discovery - #48
Conversation
- Add exhaustive course/activity inventory and semantic source search - Preserve evidence, coverage, temporal scope, and quiz safety contracts - Add local Moodle test-service tooling and regression coverage
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bcd1aba868
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| unmatchedHints: string[]; | ||
| } | ||
|
|
||
| const OBLIGATION_SIGNAL = /\b(?:haus(?:ü|ue)bung(?:en)?|homework|assignments?|aufgaben?|to[- ]?dos?|abgaben?|submission(?:s)?|erledigen|machen\s+muss|machen\s+soll|vorbereiten|prepare|complete)\b/i; |
There was a problem hiding this comment.
Require task context before enabling obligation discovery
Standalone words such as complete and prepare are sufficient to set requested, so an ordinary prompt such as “Give me a complete explanation of Fourier transforms” is routed by classifyStudyBuddyIntent into an exhaustive current-semester Moodle obligation audit instead of answering the requested topic. Require an obligation noun or due/list context rather than treating these generic study verbs and adjectives as obligation signals by themselves.
AGENTS.md reference: AGENTS.md:L3-L3
Useful? React with 👍 / 👎.
| maxPages: budget.maxMoodlePages, | ||
| maxDepth: budget.maxMoodleDepth, | ||
| maxCisPages: 0, |
There was a problem hiding this comment.
Honor explicit CIS source overrides during obligation scans
When an obligation prompt is combined with --source-mode cis or --source-mode both, planFromOverride includes CIS, but this branch unconditionally passes maxCisPages: 0 to the CIS scraper. Its crawl loop therefore never opens a page, and a CIS-only request returns no requested source evidence; retain the configured CIS budget whenever the source plan targets CIS.
Useful? React with 👍 / 👎.
| maxPages: budget.maxMoodlePages, | ||
| maxDepth: budget.maxMoodleDepth, |
There was a problem hiding this comment.
Preserve configured Moodle crawl limits
The obligation branch replaces config.maxPages and config.maxDepth with fixed task-budget values instead of applying them as upper bounds. Consequently, the CLI's advertised default maximum of 8 pages becomes 24 or 64, and even an explicit --max-pages 1 can be expanded to 64 for an exhaustive request, allowing a bounded invocation to perform a much longer crawl than requested.
Useful? React with 👍 / 👎.
| for (const pattern of patterns) for (const match of text.matchAll(pattern)) { | ||
| if (!addDate(match[2] ? +match[2] : year, index + 1, +match[1], match.index!)) return invalid("Invalid calendar date"); |
There was a problem hiding this comment.
Resolve yearless future dates without using a past year
Named dates without an explicit year are always assigned the current calendar year. After that date has passed—for example, asking in September 2026 what is due by January 15—the request resolves to January 15, 2026; an until request then has a start later than its end and silently filters out all obligations or calendar events instead of targeting January 2027 or reporting the date as ambiguous.
Useful? React with 👍 / 👎.
Summary
Adds generic Moodle obligation discovery for assignment, submission, preparation, and related requests. The source broker now performs calendar-aware or exhaustive course/activity traversal, records coverage and completeness, preserves direct activity provenance, supports bounded semantic resolution, and fails closed for incomplete negative answers. The change also strengthens source evidence caching, temporal request handling, interactive quiz safety boundaries, progress publication, and Moodle lab diagnostics/documentation.
Verification
CHANGELOG.mdwhen needed.captures, student records, or non-redistributable course material.
Commands and results:
Security and privacy impact
The change keeps Moodle discovery read-only and preserves the existing quiz permission boundary: it does not start attempts, modify answers, save responses, or submit quizzes. Source URLs, evidence, caches, and workflow state remain account-scoped and bounded; private credentials, cookies, authenticated captures, and student records are excluded. Incomplete traversal produces explicit coverage gaps and cannot support an ungrounded negative answer.