Skip to content

perf(oneroster): use delta reads with bounded resumable Classroom reconciliation - #80

Open
Sykezzz wants to merge 3 commits into
district-mainfrom
integration/oneroster-delta-windows-pin
Open

perf(oneroster): use delta reads with bounded resumable Classroom reconciliation#80
Sykezzz wants to merge 3 commits into
district-mainfrom
integration/oneroster-delta-windows-pin

Conversation

@Sykezzz

@Sykezzz Sykezzz commented Aug 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds durable verified state for exact Section_<ID> managed courses.
  • Skips unchanged metadata and roster reads.
  • Keeps teacher and student reads role-specific.
  • Chunks remaining exact Classroom reads.
  • Persists successful chunks so retries resume incomplete work.
  • Prevents rate-limited bulk reads from exploding into per-alias requests.
  • Integrates the Windows GAM 7.47.06 pin repair.

Safety

  • No tenant-wide Classroom discovery is introduced.
  • Unrelated preexisting Classrooms remain outside OneRoster scope.
  • Destructive actions still require fresh target evidence.
  • Teacher-authored descriptions remain untouched.
  • Exact alias-to-course binding remains enforced.
  • Branch 1 and Branch 2 commits remain in history.
  • Windows hotfix remains a distinct cherry-picked commit.

Local evidence

  • OneRoster regression set:
    96 passed, 0 failed, 0 skipped in 58.52s
  • Hotfix-focused tests:
    24 passed, 2 skipped in 2.11s
  • The two skips require the vendored GAM command reference and are delegated to gam-compat.
  • git diff --check passed.
  • Worktree was clean.

Required merge gates

  • All required CI checks pass.
  • gam-compat executes the two locally skipped compatibility checks.
  • Separate read-only Windows acceptance passes.
  • No automatic merge.

@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: 08adb8297f

ℹ️ 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".

last_error_code TEXT NOT NULL DEFAULT '',
version INTEGER NOT NULL DEFAULT 1,
updated_at REAL NOT NULL DEFAULT 0,
PRIMARY KEY(domain, alias)

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 Make managed aliases case-insensitive in SQLite

Treat the registry key as case-insensitive here, matching the planner and connector's pervasive casefold() semantics. If a SIS later changes only the casing of a section ID (for example, Section_ABC to Section_abc), record_managed_course_desired() inserts a second row rather than updating the first; subsequent verification can then fail on the unique course-ID index or return an arbitrary state after both rows collapse to the same case-folded dictionary key. Use a NOCASE key/unique constraint and handle existing duplicates during migration.

Useful? React with 👍 / 👎.

Comment on lines +579 to +585
rows = conn.execute(
"""
SELECT * FROM managed_course_state
WHERE domain = ? ORDER BY alias COLLATE NOCASE
""",
(self.domain,),
).fetchall()

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 Filter managed-state reads by requested aliases

When aliases is supplied, this query still loads every managed-course row for the domain and filters only after materialization. The planner invokes this method once per 200-course metadata chunk and once per 100-course roster chunk, so a 50,000-course district can deserialize tens of millions of rows during one initial reconciliation, substantially undermining the bounded-read performance this change introduces. Apply the requested alias set in SQL, using bounded batches or a temporary table where necessary.

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