Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Every skill action maps to a `reg-*` CLI command. An agent performing any Lecter
| Normalize Canvas grades export | `reg-lms-grades-import` | `lms_grades` |
| Normalize CSULB enrollment roster | `reg-lms-roster-import` | `lms_roster` |
| Canvas API: export/push grades, roster check, post announcements, discussions, assignments, syllabus | `reg-canvas` | `canvas` (client: `canvas_api`) |
| Canvas gradebook audit; grade discussions by post count | `reg-canvas audit`, `reg-canvas discussions` | `canvas_grading` |
| Pre-seed GitHub Classroom roster | `reg-classroom-roster-seed` | `classroom_seed` |
| Bind student GitHub IDs to roster entries | `reg-github-bind` | `github_bind` |
| Publish ISA grading artifacts to Drive | `reg-isa-publish` | `isa_publish` |
Expand All @@ -44,7 +45,7 @@ releases. `reg-exam-readinglist` is installed as a standalone `~/bin` wrapper (n
- All commands accept `--vault-root <path>` to locate vault notes. Pass it explicitly; never rely on a hard-coded default.
- Prefer `--dry-run` on `reg-term-finalize` before committing; the agent should surface the preview output for review.
- `reg-term-archive --check` exits 0 on a clean bundle and nonzero on drift — use the exit code as a quality gate.
- **`reg-canvas` writes are dry runs until `--apply`.** Show the dry run first. An agent never passes `--apply` to a live section (announcements notify students at once; grades are visible once posted) without the instructor's go-ahead for that specific run. Test against the sandbox course with `--course-id`.
- **`reg-canvas` writes are dry runs until `--apply`.** Show the dry run first. An agent never passes `--apply` to a live section (announcements notify students at once; grades are visible once posted) without the instructor's go-ahead for that specific run. Test against the sandbox course with `--course-id`. The same holds for `reg-canvas discussions apply`: show its dry run, and `--post` only with the go-ahead, since posting reveals every hidden grade on the assignment.
- **Never read the Canvas token file** (`~/.config/lectern/canvas-token`). The client reads it; nothing else needs to.
- All state lives in plain files (Markdown · CSV · YAML · LaTeX) — the agent can read and diff these directly.

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ All notable changes to lectern are documented here.
## [Unreleased]

### Added
- **`reg-canvas audit` and `reg-canvas discussions`: gradebook audit and discussion grading.** The first full read of the Fa26 gradebooks found no forgotten posting, but it did find three problems. Weeks 5 and 6 were ungraded in every section. 326 §03's Exam 1 was filed under Class Participation, so it counted at 10% instead of 60%. And 378's missing-submission policy was off, so non-posters were blank and left out of the current score. `audit` reports all three kinds of problem, plus hidden grades (missing-work zeros counted apart), and exits 1 when it finds something. `discussions review` grades by post count (2 or more = 5, 1 = 3) and writes a vault note listing only the posts that need a human look: one post, a post under 25 words, or 30% phrase overlap with another student. Each of those posts has a deny box. `discussions apply` reads the ticks back and sets changed scores, likes every credited post, and with `--post` posts the grades. It is a dry run until `--apply`. Posts are read to measure them, as an instructor does in SpeedGrader, and the text is reduced to metrics in memory. It is never written, printed or kept, and a test enforces that. The metrics (length, Flesch-Kincaid grade, sentence-length spread, vocabulary ratio, reply structure, names a classmate, links, overlap) are documented as prompts to read, not an AI detector. `--exclude-sis` and `--full-credit-sis` take `SIS@326-03` to scope to one section. Live-checked read-only on the three Fa26 sections, with the same counts as the prototype scripts. New module `canvas_grading`; runbook sections in `docs/canvas-api.md`.
- **`reg-lms-grades-import --exclude-sis`: course staff with a student role.** A grad assistant who needs the student view is enrolled as a student in every section's Canvas course, so the export lists them like a student and `reg-gradebook import` stops with "in Canvas but not in roster". Their SIS IDs now go to `grades.filtered.csv` with reason `staff`, alongside the Test Student and ISA filters. `reg-canvas grades-export --import` passes the same flag through. Found on the first live `reg-canvas` export, 2026-10-21.
- **`docs/gradescope-workflow.md`: getting Gradescope totals back into lectern.** Gradescope has no instructor API and a Canvas token does not reach it, so the doc now describes the supported route: link the course through Gradescope's Canvas tool (LTI 1.3), post totals to Canvas, and read them with `reg-canvas grades-export`. It warns against pushing the same column from both Gradescope and `reg-canvas grades-push`, and notes that item analysis still needs the per-question export.
- **`reg-canvas`: Canvas API support.** CSULB ATS issued a personal Canvas token on 2026-10-21. Until then lectern had no Canvas integration, and every Canvas step was a manual export, upload or paste. The new `canvas_api` module is the only code that touches the token. It reads the token from `~/.config/lectern/canvas-token` and refuses a file that group or other can read. It never takes the token from argv or the environment, sends it only to the configured host, refuses redirects (urllib would forward the `Authorization` header to the redirect's host), and scrubs it from every error. It uses only the standard library, so lectern's runtime dependencies do not change. `reg-canvas` puts nine subcommands on top of it. The read commands are `whoami`, `courses` (`--bind` writes `canvas.course-id` into each class note, using the term name when a class number recurs across years), `grades-export` and `roster-check` (Canvas compared with the registrar roster, for census week). `grades-export` writes the same CSV that Canvas's *Export* button does, so `reg-lms-grades-import` and `reg-gradebook export-canvas --template` take it unchanged; the per-group subtotal columns are the one difference, and nothing reads them. The write commands are `grades-push`, `announce`, `discussion`, `assignment` and `syllabus`, and each is a dry run until `--apply`. `grades-push` applies an overlay CSV, changed cells only. A blank cell never clears a grade, and a file whose assignment IDs belong to another course is refused. `discussion` and `assignment` create items unpublished, `assignment --lab N` takes its name and points from the vault, `syllabus` refuses a file without the class note's serial, and all three content commands skip a title that already exists. Data scope is what was promised to CSULB IT: names, student IDs and grades for the instructor's own sections. Scores come from the submissions endpoint, but only score fields are kept and submission content is dropped on arrival. Exports are written mode 600. Live-checked on 2026-10-21 against the three Fa26 sections (reads) and the sandbox course (an unpublished discussion and assignment, since deleted). Runbook: `docs/canvas-api.md`, which opens with how the pieces fit and ends with troubleshooting. The README (intro, command table, architecture, dependencies, an optional quickstart), `SKILL.md`, `AGENTS.md` and `docs/canvas-grades-workflow.md` all describe the API path, and each repeats that writes are dry runs until `--apply`.
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ This is a deliberate design principle, not an accident. Proprietary LMS gradeboo
| `reg-exam-build` | `exam_build` | Assemble exam PDFs — single-source `.tex` mode or pack-mode `.yaml` manifest (multi-form A/B/C, per-student individualized, Gradescope products). See below. |
| `reg-exam-verify` | `exam_verify` | Verify a student exam serial against the register. Confirms which form and which student a paper belongs to. |
| `reg-lms-grades-import` | `lms_grades` | Normalize a Canvas `grades.csv` export to Lectern's canonical format. |
| `reg-canvas` | `canvas` + `canvas_api` | **Canvas API.** Reads: `whoami`, `courses` (`--bind` links each section to its Canvas course in the class note), `grades-export` (the gradebook in Canvas's own export layout, so `reg-lms-grades-import` and `reg-gradebook export-canvas --template` take it unchanged), `roster-check` (Canvas compared with the registrar roster). Writes, each a **dry run until `--apply`**: `grades-push` (an overlay CSV, changed cells only; a blank never clears a grade), `announce`, `discussion` and `assignment` (both unpublished by default), and `syllabus` (refuses a file without its serial). The token lives in one mode-600 file and is sent to one host. See [docs/canvas-api.md](docs/canvas-api.md). |
| `reg-canvas` | `canvas` + `canvas_api` | **Canvas API.** Reads: `whoami`, `courses` (`--bind` links each section to its Canvas course in the class note), `grades-export` (the gradebook in Canvas's own export layout, so `reg-lms-grades-import` and `reg-gradebook export-canvas --template` take it unchanged), `roster-check` (Canvas compared with the registrar roster), `audit` (ungraded or unposted work, empty weighted groups, a missing-submission policy that is off). Writes, each a **dry run until `--apply`**: `grades-push` (an overlay CSV, changed cells only; a blank never clears a grade), `announce`, `discussion` and `assignment` (both unpublished by default), `syllabus` (refuses a file without its serial), and `discussions` (grades discussion assignments by post count: `review` writes the short list to judge as a vault note with a deny box per post, `apply` sets scores and likes). The token lives in one mode-600 file and is sent to one host. See [docs/canvas-api.md](docs/canvas-api.md). |
| `reg-lms-roster-import` | `lms_roster` | Normalize a faculty-center enrollment roster (`.xls`/`.xlsx`) to Lectern's canonical format. |
| `reg-classroom-roster-seed` | `classroom_seed` | Pre-seed a GitHub Classroom roster from a normalized roster CSV, using the 9-digit student ID as the identifier. |
| `reg-github-bind` | `github_bind` | Bind student GitHub usernames to roster entries — from a Google Form CSV, a GitHub Classroom roster CSV, or org-scrape mode. |
Expand Down Expand Up @@ -142,6 +142,7 @@ lectern/
lms_roster.py enrollment roster normalization (.xls → .csv)
canvas_api.py Canvas REST client: the only module that reads the token
canvas.py reg-canvas: gradebook export/push, roster check, content posting
canvas_grading.py reg-canvas audit + discussions: gradebook audit, discussion grading
classroom_seed.py GitHub Classroom roster pre-seeding
github_bind.py student-id → GitHub username binding
isa_publish.py Drive publishing (rclone/service-account backend)
Expand Down
12 changes: 11 additions & 1 deletion SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ records of running courses. All tools are vault-aware via an explicit
| `reg-lms-roster-import` | lms_roster | Normalize a CSULB faculty-center roster export |
| `reg-c50` | c50 | **Classroom 50** — the GitHub Classroom successor (legacy sunset 2026-08-28). `classroom-add` creates one classroom per section from the term-spec · `codes` mints the per-section self-enrollment codes · `roster-import` turns collected GitHub usernames into a roster + org invitations · `post` registers a lab as an assignment in every section that teaches it, binds it into the class notes, and writes the Canvas announcement · `status` reads back what is actually registered. Resolves org, classroom, slug, template, points and due date from the vault rather than the command line |
| `reg-guardcheck` | guardcheck | **In-CI course-file notification.** `stamp` records the expected digests of a template's guard files; `check` runs inside the lab's own autograde workflow and tells the *student* when one has changed. ==Notifies, never grades==: no points, no pass/fail, always exits 0 (`--strict` opts out). Stdlib-only so a template can vendor the single file. The authoritative check is instructor-side `reg-triage`, which reads git history from outside the student's control |
| `reg-canvas` | canvas | **Canvas API.** Reads: `whoami`, `courses` (`--bind` records each section's `canvas.course-id` in its class note), `grades-export` (the gradebook as the same CSV Canvas's *Export* writes, into `archives/<term>-<sec>/canvas/`, `--import` chains `reg-lms-grades-import`), `roster-check` (Canvas vs registrar roster). Writes, ==dry run unless `--apply`==: `grades-push` (a Canvas-format import CSV, changed cells only), `announce`, `discussion` (unpublished by default), `assignment` (`--lab N` fills name + points from the vault), `syllabus` (refuses a file without the class note's serial). Token: `~/.config/lectern/canvas-token`, mode 600, never in argv, logs or the vault. Runbook: `docs/canvas-api.md` |
| `reg-canvas` | canvas | **Canvas API.** Reads: `whoami`, `courses` (`--bind` records each section's `canvas.course-id` in its class note), `grades-export` (the gradebook as the same CSV Canvas's *Export* writes, into `archives/<term>-<sec>/canvas/`, `--import` chains `reg-lms-grades-import`), `roster-check` (Canvas vs registrar roster), `audit` (ungraded/unposted work, empty weighted groups, missing policy off). Writes, ==dry run unless `--apply`==: `grades-push` (a Canvas-format import CSV, changed cells only), `announce`, `discussion` (unpublished by default), `assignment` (`--lab N` fills name + points from the vault), `syllabus` (refuses a file without the class note's serial), `discussions review|apply` (grade discussions by post count: 2+ = 5, 1 = 3; a vault note lists only the posts to judge, each with a deny box; likes, no comments; `--post` reveals hidden grades). Token: `~/.config/lectern/canvas-token`, mode 600, never in argv, logs or the vault. Runbook: `docs/canvas-api.md` |
| `reg-classroom-roster-seed` | classroom_seed | ==**RETIRED** — legacy GitHub Classroom, and it never worked live== (it POSTed to a read-only endpoint). Kept only so old runbooks resolve. Use `reg-c50 roster-import` |
| `reg-github-bind` | github_bind | Bind student GitHub IDs to roster entries |
| `reg-isa-publish` | isa_publish | Publish ISA grading artifacts to Drive (rclone/gdrive backend) |
Expand Down Expand Up @@ -280,6 +280,11 @@ reg-canvas grades-push --term fa26 --vault-root <V> --course "CECS 326" --sectio
--file canvas-lab2-import.csv --only "Lab 2 - …" # dry run; add --apply
reg-canvas announce --term fa26 --vault-root <V> --course "CECS 326" \
--file '<lab>/posted/fa26-{section}-ANNOUNCE.md' # dry run; add --apply
reg-canvas audit --term fa26 --vault-root <V> # what was never graded or posted
reg-canvas discussions review --term fa26 --vault-root <V> --week "Week 7" \
--workdir ~/tmp/canvas-discussions/fa26-w7 # writes the vault note to judge
reg-canvas discussions apply --workdir ~/tmp/canvas-discussions/fa26-w7 \
--note <V>/classes/semesters/fa26-discussions-w7-grading.md --post # dry run; add --apply
```

==Every write is a dry run until `--apply`.== An agent shows the dry run and
Expand All @@ -289,6 +294,11 @@ sandbox) bypasses the vault for testing. ==Never read the token file.==

**Data scope** matches what was promised to CSULB IT on 2026-10-16: course
content, plus names, student IDs and grades for the instructor's own sections.
`discussions review` also reads discussion posts, the same reading done by
hand in SpeedGrader: the text is reduced to counts and writing metrics in
memory and never written. The metrics are prompts to read a post, ==never an
AI-detection verdict==; the course discussion rules promise "no checker, no
accusations".
`grades-export` reads scores from the submissions endpoint but keeps only
score fields, dropping submission content on arrival. Exports are written
mode 600.
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
| Document | Description |
|---|---|
| [gradescope-workflow.md](gradescope-workflow.md) | Step-by-step for taking a lectern-built exam into Gradescope: region/bubble setup, A/B Version Sets, roster import, per-student serial identity verification |
| [canvas-api.md](canvas-api.md) | *About 15 min to set up.* `reg-canvas`: Canvas token setup, linking sections to courses, gradebook export, roster check, and the dry-run-first write commands (grades, announcements, discussions, assignments, syllabus) |
| [canvas-api.md](canvas-api.md) | *About 15 min to set up.* `reg-canvas`: Canvas token setup, linking sections to courses, gradebook export, roster check, and the dry-run-first write commands (grades, announcements, discussions, assignments, syllabus), the gradebook audit, and discussion grading |
| [canvas-grades-workflow.md](canvas-grades-workflow.md) | Pushing vault grades to Canvas for one assignment via a Canvas-export **template overlay**: id-suffixed assignment match, `--only` targeting, minimal diff, extra-credit handling |
| [admin-forms.md](admin-forms.md) | Filling a campus administrative form (Notice of Absence and friends) from the vault's own records: identity setup, campus closures in the term-spec, the three rendered products, and how to add a new form as a profile |

Expand Down
Loading
Loading