Skip to content

TIG-282: import taken and current courses from a transcript PDF - #548

Open
Windshield-Viper wants to merge 30 commits into
parallel-planning/viewfrom
tig-282-transcript-import
Open

Windshield-Viper wants to merge 30 commits into
parallel-planning/viewfrom
tig-282-transcript-import

Conversation

@Windshield-Viper

@Windshield-Viper Windshield-Viper commented Nov 24, 2026 •

Copy link
Copy Markdown

TIG-282: import taken and current courses from a transcript

Closes TIG-282. Base: parallel-planning/view. Independent of TIG-330/337.

This replaces #547, which had grown to 60+ review comments. The code is the same branch, plus the fix for the last review round (schedule loads and saves now name their plan; see below).

What it does

Header → Import transcript. The student uploads the TigerHub unofficial transcript PDF. TigerPath lists the courses it found, each marked Taken or Taking now with the semester it'll go in. The student unchecks anything they don't want, picks which plan to Add to (defaults to the current plan), and confirms. The courses are added with one schedule save to that plan, skipping any already there; the confirmation says how many. Adding to another plan saves it by id without switching first, then opens it if you're still where you started. The review step also says which class year it used for placement, so a wrong year in Settings shows up before anything is added.

Changes

  • tigerpath/transcript.py: the parser, written as small pure functions.
    • It recognises term headings such as "2026-2027 Fall", "Fall 2023" and "Spring Term 2022-23", and course rows such as COS 226 or COS126.
    • Status is read by column: grade basis, then title, then grade, skipping the trailing Distrib Area. A final grade means taken; a blank grade or IP means currently taking; W (withdrawn) is skipped.
    • It also runs locally: python -m tigerpath.transcript TRANSCRIPT.pdf [CLASS_YEAR] prints codes, terms and status, never grades.
  • POST /api/v1/import_transcript/: login required. It parses the PDF in memory and returns a preview.
    • Nothing is stored and nothing is saved.
    • Grades are never returned.
    • The file never touches disk: memory-only upload handler and a 2 MB cap. Requests that are too large or don't state their length are refused before the body is read. PDFs over 20 pages are refused.
    • PDFs locked with an empty password (TigerHub's are) open; PDFs that need a real password are refused.
  • Frontend: ImportTranscriptModal, plus helpers/transcript.js for building the review rows and applying the import. The planner gets an importCourses action, and the header gets the new button.
  • Schedule loads and saves name their plan (tigerpath/views.py, api.js, usePlanner.js):
    • The problem: the server saved every schedule to the active plan, and switching plans changes that at once. So a save still in flight during a switch, or an import into another plan, could land on the wrong plan.
    • Reads: get_schedule and get_requirements take an optional ?planId=.
    • Saves: update_schedule and update_schedule_and_get_requirements take an optional planId and write only that plan.
    • Other users' plans: return 404 and nothing is written.
    • Without planId: nothing changes, so the classic UI is untouched.
    • The new planner: it saves to the plan its schedule came from, and never saves over a plan that failed to load.
    • Order: saves to one plan go out one at a time, so they can't land out of order. An import into a plan waits its turn after edits already sent. Loading a plan waits for writes already sent to it, so switching away and straight back never shows a pre-edit schedule. Duplicating a plan, and the import dialog's check for courses already in a plan, wait the same way.
    • Failures are always reported: a save that fails after you leave its plan (or come back to it), a failed plan switch, and a plan that fails to load (an empty board would look like deleted courses).
    • POST only: save endpoints refuse GET with a 405. CSRF only covers POST, and a GET used to clear the active plan's schedule (this bug predates the PR). A schedule that isn't a JSON list gets a 400.
  • New dependency: pypdf==6.21.4 (pure Python).

Rows that can't be added

  • the course is already in the plan
  • it's listed twice on the transcript
  • its term falls outside the student's four years
  • there's no class year to place it (the dialog says to set one in Settings)

Courses missing from the catalog are listed as "not added".

Testing

  • pytest tigerpath: 64 pass. New tests cover:

    • plan-scoped saves: a save naming a non-active plan lands there, and another user's plan is rejected;
    • GET and malformed saves, which change nothing;
    • upload limits: size, missing length, page count, CSRF, and the in-memory upload setting;
    • parser: rows after the summary block or an advanced-standing section aren't filed into the last term.

    Older tests also cover the parser, extraction from generated PDFs, the TigerHub column layout, PDFs with an empty versus a real password, the endpoint (no save, no grades), bad uploads, login, and the no-class-year case.

  • bun run test: helper tests pass. vite build: passes. ruff: clean on the new files.

  • A real TigerHub transcript: checked locally (nothing from it is committed). All four in-progress courses were found and placed in the right semester. Fixture rows in the same layout guard against regressions.

  • Manual: I ran the full flow in the new planner. The upload only previews; Add makes exactly one schedule save. With slowed-down saves, I also checked these cases:

    • save, then switch plans at once;
    • import into another plan;
    • import, then switch elsewhere;
    • import, then open the target plan;
    • a plan that failed to load;
    • two quick edits;
    • switching back mid-switch;
    • switching away and back during a slow save;
    • duplicating during a slow save;
    • previewing an import into a plan with a slow save still pending;
    • a failing save, a failing switch, and a failing load (each shows a notice).

    Each save landed only on its own plan.

Not yet verified

A real transcript with finished terms, that is, letter grades in the Grade column. The layout is the same and tests cover it.

Decisions

docs/decisions/TIG-282-transcript-import.md. D6 was revised in review: import now lets you choose the plan. D8 explains plan-scoped saves.

Merging with #545 and #546

This PR is independent of them. If it merges after #546, App.jsx, usePlanner.js, Icon.jsx and styles.css conflict, but both sides only add code, so keep both. For styles.css, paste each branch's added section in whole rather than accepting git's line-by-line merge, which interleaves the two blocks and breaks the braces. A combined build with all three PRs passes its tests on a local branch. views.py and api.js: get_requested_plan, getSchedule(planId) and getRequirements(planId) do the same thing in both PRs. Keep this PR's versions: they are a superset, since saves take planId too. usePlanner.js: #546's calls to loadPlanContents() should pass the plan id (payload?.activePlanId). In #546's selectPlan, the "already active" early return should use this PR's check, id === activePlanRef.current && pendingActions.current === 0. Also, updatePlan now goes through changeActivePlan (planAction is gone). #546's loadCompare should also wait for the compared plan's pending writes (writeChains.current[String(planId)]) before reading it: after a swap, the compared plan is the one just being edited. The demo branch does this. One more spot needs more than keep-both: in usePlanner.js, selectPlan should keep #546's compare-swap logic but make its api.setActivePlan calls through this PR's changeActivePlan(() => ...), with both PRs' dependencies in the useMemo list.

Screenshots

Upload

Import transcript upload dialog

Review, with the Add to picker and the class year it used

Import review list with the Add to plan picker

🤖 Generated with Claude Code

Windshield-Viper and others added 23 commits November 23, 2026 21:03
Header -> Import transcript: the student uploads the TigerHub unofficial
transcript PDF, reviews the courses found (taken / taking now, target
semester), and adds the ones they choose to the active plan.

- POST /api/v1/import_transcript/ parses the PDF in memory with pypdf and
  returns a preview. Nothing is stored or saved; grades are never returned.
- tigerpath/transcript.py: tolerant term/course/status parser, runnable
  locally to check a real transcript without uploading it.
- Courses already in the plan, outside the four years, or missing a class
  year can't be added; catalog misses are listed.
- Chosen courses are added with one normal schedule save.
- Tests: 10 backend (parser, real PDF extraction, endpoint, no-save,
  bad uploads) and frontend helper tests.

Decision log: docs/decisions/TIG-282-transcript-import.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Checked against a real TigerHub "Undergraduate Internal Transcript" PDF:
- open PDFs encrypted with an empty open-password (TigerHub's are);
- allow column spacing between dept and number ("COS     226");
- read status by column (grade basis, title, grade), skipping the
  trailing Distrib Area, so taken courses aren't shown as in progress
  and a title ending in "B" or an AUD basis is never a grade.
Regression tests use made-up courses in the same layout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The import review step gets an "Add to" dropdown (defaults to the current
plan). Importing into another plan switches to it, waits for its schedule,
then adds the courses with one normal save, skipping any already there and
saying how many in the confirmation. No backend change.

Decision log D6 revised.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Placement depends entirely on the profile's class year; saying it in the
review step makes a wrong year obvious before anything is added.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
'2022-2023 Summer' wasn't recognised as a term heading, so summer courses
were filed under the previous spring. Summer, winter and intersession
headings now match in both orders, like fall and spring. Regression test
added. (Codex review on #547.)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When importing into another plan, a failed schedule load fell back to an
empty schedule, which the pending import then saved, replacing the plan's
real courses. The load failure is now tracked and the import is cancelled
with an error notice instead. (Codex review on #547, P1.)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d to load

The failed-load guard only covered importing into another plan. Importing
into the current plan after its schedule failed to load still saved over
the empty placeholder. Same guard now applies to both paths.
(Codex review on #547.)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
'Summer Term 2022-23', 'Summer 2022-2023' and 'Intersession 2023-2024'
were already recognised (the season-first pattern matches the first year);
these tests make that explicit, including a summer course being skipped
after a spring term. Responds to a Codex review note on #547.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Plan loads now carry a sequence number and only the newest may set the
  schedule. A slow response for the previous plan arriving after a switch
  could otherwise be taken as the target plan's schedule, and a pending
  import would save the wrong plan's courses over it. Verified with
  delayed responses.
- Transcript rows with grade basis AUD are skipped: audits earn no credit
  and must not be imported as courses that satisfy requirements.
(Codex review on #547.)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Clicking Add while the current plan was still loading did nothing and
said nothing. The import now waits for that plan's schedule (the same
pending path as importing into another plan) and reports an error if the
load fails. (Codex review on #547.)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An import queued while a plan was loading stayed pending if the student
switched to another plan, then applied unexpectedly on returning. It is
now cancelled with a notice when the student goes to any plan other than
its target (the import's own switch is exempt). (Codex review on #547.)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Rows graded F are skipped like W and AUD: they earn no credit and must
  not satisfy requirements.
- A pending import is exempt from cancellation only while its own plan
  switch is in flight; returning to the starting plan afterwards now
  cancels it instead of leaving it to apply later.
(Codex review on #547.)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lumns

When layout extraction fails and columns collapse, a row like
'Physics Lab Part B SEN' is ambiguous. In that fallback a lone letter now
only counts as a grade next to a credit/grade-point number; otherwise the
row is kept as in progress (status is a review label, never saved), so an
ambiguous title can't drop a course or mislabel it as taken. Multi-letter
grades (A-, B+, IP, INC) still count. Tests cover both cases.
(Codex review on #547.)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The server activates the new plan as soon as set_active_plan lands, before
the client applies the response. A slow schedule load for the old plan
arriving in that window could complete a pending import, and the save
would go to the newly active plan. Starting any plan switch now bumps the
load sequence so those responses are ignored; the pending import is then
cancelled. Verified with delayed responses. (Codex review on #547.)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Without table columns, a row ending in a lone grade letter can't be told
apart from a title ending ('Part B') or a withdrawal ('Microeconomics W').
Earlier fallbacks either dropped such rows or kept them as in progress.
They are now marked 'Check grade' and shown unchecked: a possible
withdrawal is never added automatically, and a real course is never
silently dropped. Letters next to credit numbers still count as grades.
(Codex review on #547.)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Create, copy and delete can change the server's active plan just like a
  tab switch, so they now also invalidate in-flight loads for the plan
  being left (a waiting import can't save onto the new plan).
- If any of those actions fails, the current plan is reloaded so it never
  stays stuck on 'Loading your plan...'.
- INC (incomplete: not finished at the end of the term) is no longer
  treated as completed; such rows are 'Check grade', unchecked.
(Codex review on #547.)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When a course appeared first as INC/unclear and later with a passing
grade, the first (unchecked) row blocked the completed one as 'Listed
twice'. Repeats now keep the first taken/in-progress row, falling back to
the first row only if every attempt is unclear. Test added.
(Codex review on #547.)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An expired session redirects the upload to the login page, which answers
200 with HTML; that used to read as an empty preview ('No Princeton
courses were found'). Redirected or non-JSON responses now raise a
'session expired' error, and the preview shape is validated.
(Codex review on #547.)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
If an import's switch to plan B was still in flight when the student
started another plan change (to C), B's late response could start a load
that read server-active C as B's schedule, and the pending import would
save onto C. Active-plan actions are now sequenced: an older action's
response is ignored once a newer one has started. Verified with delayed
switches. (Codex review on #547.)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Active-plan changes are queued and run in order, so overlapping
  switches can't leave the server on one plan and the page on another.
- After a failed or half-finished plan change (e.g. a plan created but
  its settings save failed), the page re-reads the plan list and the
  active plan so it matches the server.
Verified with delayed and failing requests. (Codex review on #547.)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A row like 'COS 126/EGR 126  AUD  ...' left '/EGR 126' in front of the
grade-basis column, so the audit wasn't detected. Extra cross-listed
codes after the first are now stripped before the columns are read. Test
added. (Codex review on #547.)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The server saved schedules to whichever plan was active, so a save in flight
during a plan switch, or an import into another plan, could land on the wrong
plan. Loads and saves now take a planId (optional; the classic UI is unchanged),
the planner saves to the plan its schedule came from, and imports into another
plan read and save that plan by id instead of switching first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…witches

Opening the target plan now waits until the import is saved, so the old copy
can't be loaded and edited over it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@linear

linear Bot commented Nov 24, 2026

Copy link
Copy Markdown

TIG-282

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T23:57:15.815603Z 43d8bf4 Manual request
ℹ️ 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.

@Windshield-Viper

Copy link
Copy Markdown
Author

@codex review

@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: e64c65ff72

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

const seq = ++loadSeq.current;
const current = () => seq === loadSeq.current;
// Responses to saves made for the plan on screen until now no longer apply.
saveSeq.current += 1;

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 Report save failures after switching plans

When a schedule save is still pending and the user switches plans, this increment makes the save's rejection fail the seq === saveSeq.current check at line 135. A network or server failure therefore silently loses the edit to the previous plan: no error notice is shown and returning to that plan reveals the missing change. Invalidate stale requirement responses separately, but continue reporting failures for saves that were actually submitted.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed in 06bcfb6: stale responses are still ignored, but if a save fails after the student has left its plan (and no later save to that plan replaced it), a notice names the plan whose change was lost.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Windshield-Viper

Copy link
Copy Markdown
Author

@codex review

@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: 06bcfb61e0

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread frontend/src/new/usePlanner.js Outdated
Comment on lines +342 to +345
const stored = await api.getSchedule(target);
const result = applyImport(stored && stored.length ? stored : emptySchedule(), rows);
if (result.added > 0) {
await api.saveScheduleAndGetRequirements(stripSchedule(result.schedule), target);

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 Serialize target imports with pending schedule saves

When a student edits plan A, switches to plan B before A's save resolves, and then imports into A, this read-modify-write runs only behind actionQueue; the normal save started by commitSchedule is not in that queue. If the import reads A before the pending save lands, its subsequent save can overwrite the recent edit, while the opposite completion order can erase the imported courses. Serialize saves per plan or await any pending save for target before reading and replacing its schedule.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed in 41a7a72: each plan's in-flight saves are tracked, and an import into that plan awaits them before reading and saving its schedule. Checked in the preview: edit plan A with a slow save, switch to B, import into A; both the edit and the imported courses end up on A.

Comment thread tigerpath/views.py Outdated
Comment on lines +1153 to +1154
if upload.size > MAX_TRANSCRIPT_BYTES:
return JsonResponse({"error": "Upload a transcript PDF under 5 MB."}, status=400)

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 Keep accepted transcript uploads out of temporary files

For uploads between Django's default 2.5 MiB in-memory threshold and this 5 MiB limit, Django has already spooled the transcript to a temporary file by the time this size check runs. That contradicts the dialog and privacy design's promise that sensitive transcript data is read in memory and not stored; configure upload handling so accepted files remain in memory, or lower the accepted limit to the configured memory threshold.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed in 41a7a72: each plan's in-flight saves are tracked, and an import into that plan awaits them before reading and saving its schedule. Checked in the preview: edit plan A with a slow save, switch to B, import into A; both the edit and the imported courses end up on A.

Transcript uploads now use only the in-memory upload handler and are capped
at 2 MB (below Django's spool threshold), so they never touch disk. An import
into a plan waits for that plan's in-flight saves before reading it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Windshield-Viper

Copy link
Copy Markdown
Author

@codex review

@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: 41a7a723f1

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +330 to +332
if (target === schedulePlanId.current && schedule && !scheduleLoadFailed) {
const { schedule: next, added, skipped } = applyImport(schedule, rows);
if (added > 0 && commitSchedule(next) === false) return 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 Wait for active-plan saves before importing

When the student imports into the plan currently on screen while an earlier edit save is still in flight, this fast path immediately starts another commitSchedule instead of awaiting pendingSaves.current[target] as the other-plan path does. If the older request reaches its database write after the import request, its full-schedule payload overwrites the newly imported courses; serialize this path behind pending saves for the target plan before submitting the import.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed in 67796a8: every write to a plan (normal saves and imports, including into the plan on screen) now goes through a per-plan queue, so it runs only after earlier saves to that plan have settled and they reach the server in order.

Comment thread tigerpath/views.py
Comment on lines +1156 to +1159
try:
content_length = int(request.META.get("CONTENT_LENGTH") or 0)
except ValueError:
content_length = 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.

P2 Badge Enforce the upload cap for unknown-length requests

For a chunked request or any request with an absent/invalid Content-Length, this converts the length to zero and passes the pre-body guard. The subsequent memory-only upload handler must buffer the entire file before _import_transcript can inspect upload.size, so an authenticated request with a valid CSRF token can exceed the advertised 2 MB cap and consume memory up to any external proxy limit—or without a bound when Gunicorn is exposed directly. Reject unknown lengths or use an upload handler that aborts while streaming after the cap.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed in 67796a8: requests without a positive Content-Length are refused before the body is read (browsers always send one for a file upload), and Django's LimitedStream never reads past the stated length, so the cap holds. Login is now checked before anything else too. Test added.

- Saves to one plan go out in order (whole-schedule saves could land out of
  order); imports join the same line, including into the plan on screen.
- Save endpoints require POST (a GET used to clear the active plan) and
  reject a schedule that isn't a JSON list.
- Clicking back to the current plan during a pending switch is honoured;
  plan settings go through the plan-action queue.
- No 'couldn't save' notice for a plan that was deleted.
- Transcript upload: login checked first; requests without a length are
  refused; PDFs over 20 pages are refused; clearer network/server errors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Windshield-Viper

Copy link
Copy Markdown
Author

@codex review

@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: 67796a8e9f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

(payload) => {
if (seq !== actionSeq.current) return payload; // a newer plan action is queued after this one
applyPlans(payload);
loadPlanContents(payload?.activePlanId);

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 Wait for pending writes before reloading a plan

When a save to plan A is still in flight and the user switches A→B→A, or updates A's settings, this reload starts getSchedule(A) without waiting for A's writeChains entry. If the read wins the race, the UI displays the pre-edit schedule; the eventual save response is ignored because loadPlanContents advanced saveSeq, and the user's next edit submits that stale full schedule and silently overwrites the earlier change. Serialize this reload behind pending writes for the plan being loaded.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed in 7bc0c52: loadPlanContents now waits for every write already queued for that plan (all plans' writes when the id isn't known) before reading it. I checked every other read of a plan's schedule in this PR: the import's read is already inside the plan's write queue, the import dialog's duplicate preview is display-only and rechecked against the stored schedule on add, and the initial load happens before any write. Reproduced your A→B→A sequence with a slow save: the pre-edit schedule came back before this change and doesn't after.

Switching away and straight back could read the plan before an in-flight save
landed, show the pre-edit schedule, and save it back on the next edit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Windshield-Viper

Copy link
Copy Markdown
Author

@codex review

@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: 7bc0c52326

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread frontend/src/new/usePlanner.js Outdated
// The student has moved on (e.g. switched plans). Still say the change was lost, unless a
// later save for the same plan replaced it or the plan has since been deleted.
const plan = plansRef.current.find((p) => p.id === planId);
if (plan && lastSaveFor.current[planId] === seq && schedulePlanId.current !== planId) {

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 Report a failed save after returning to its plan

The later loadPlanContents wait-for-writes fix exposes a remaining failure path: if an edit to plan A is pending and a same-plan reload starts (for example, the user saves plan settings or switches A→B→A before the request rejects), the reload advances saveSeq but leaves schedulePlanId.current === planId. This condition therefore suppresses the failure notice; after the write chain settles, the reload fetches A's old schedule and the edit disappears silently. Report the failure whenever this is still the latest save for that plan, even if that plan is back on screen.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed in 9f29e8e: a failed save is now reported whenever it's still the latest save for a plan that still exists, including when that plan is back on screen (the reload waits for the save, so it shows what the server kept and the notice says the change wasn't saved). I also went through every other failure path: failed tab switches and failed plan loads now show a notice too, and duplicating a plan waits for saves already sent to it.

Windshield-Viper and others added 2 commits November 24, 2026 18:41
… end at summaries

- Duplicating a plan waits for saves already sent to it, so the copy has them.
- A failed save is reported even after returning to its plan; failed plan
  switches and failed plan loads show a notice. An import's own notice isn't
  replaced by the reload after it.
- The parser ends a term at the transcript summary block and at advanced
  standing / transfer / test credit sections.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…loads late

Also guard that accepted uploads fit Django's in-memory upload limit, which
the memory-only upload handler depends on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Windshield-Viper

Copy link
Copy Markdown
Author

@codex review

@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: a536369ea1

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +36 to +37
getSchedule(targetPlanId)
.then((data) => live && setOtherSchedule({ planId: targetPlanId, schedule: data }))

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 Wait for target saves before previewing duplicates

When a student removes a course from plan A, immediately switches to plan B, and selects A as the import target before A's save finishes, this read can return A's old schedule. buildImportRows then marks the transcript course as “Already in this plan” and disables it; although the eventual import correctly waits for pending writes, it receives only the remaining chosen rows, so it cannot restore the course after the removal lands. Await A's write chain before this preview read, or re-enable/rebuild stale duplicate rows from the schedule read performed during import.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed in 43d8bf4: the preview now reads the target through readPlanSchedule, which waits for that plan's queued writes first (the same queue imports and loads use). Reproduced your sequence with a slow save: before, MAT 202 showed 'Already in this plan' and was disabled; now it's pickable. I'd wrongly treated this read as display-only; it gates which rows can be chosen.

The duplicate check read the target plan before a save landed, so a course
just removed there was shown as already in it and couldn't be picked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Windshield-Viper

Copy link
Copy Markdown
Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 43d8bf4664

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

This branch has not been deployed

No deployments
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