Skip to content

feat(moodle): add source-broker obligation discovery - #48

Open
HabsaTheDog wants to merge 3 commits into
masterfrom
fix/dev-source-broker-v0.2.3
Open

feat(moodle): add source-broker obligation discovery#48
HabsaTheDog wants to merge 3 commits into
masterfrom
fix/dev-source-broker-v0.2.3

Conversation

@HabsaTheDog

Copy link
Copy Markdown
Owner

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

  • I ran the relevant typecheck/tests and listed them below.
  • I updated user/developer documentation and CHANGELOG.md when needed.
  • I considered security, privacy, permissions, data flow, and retention.
  • I added no credentials, cookies, storage state, private URLs, authenticated
    captures, student records, or non-redistributable course material.
  • New fixtures/assets/dependencies have documented provenance and licensing.
  • UI changes include a screenshot or recording with synthetic data.
  • Any submodule commit is reviewed, tested, pushed, and publicly reachable.

Commands and results:

TypeScript typecheck: passed.
Moodle/unit regression suite: passed (1,016 tests, 4 skipped).
Moodle lab Python tests: passed (13 tests).
Desktop Moodle acquisition and full output acceptance: targeted follow-up remains pending; no publication acceptance is claimed.

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.

- 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
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-09T07:08:24.593200Z bcd1aba PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 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;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Comment on lines +49 to +51
maxPages: budget.maxMoodlePages,
maxDepth: budget.maxMoodleDepth,
maxCisPages: 0,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Comment on lines +49 to +50
maxPages: budget.maxMoodlePages,
maxDepth: budget.maxMoodleDepth,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment on lines +54 to +55
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");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

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.

1 participant