TK05: work files of packs (downloads/, served by the API, logged) #635

Merged
oliver.maklott merged 2 commits from tk05-downloads into main 2026-11-10 16:51:02 +01:00

TK05 (Plan 26, Teil AZ, D515): work files of packs. Stacked on #634 (skills pin); merge that first.

Deviation from the plan, recorded in D515 and SPEC Abschnitt 5 „Arbeitsdateien“:

  • The student route carries the step: GET /api/assignments/:assignmentId/steps/:stepId/downloads/:name. The log needs the step, and the route hands out only what that step names.
  • No separate list route for teachers: schoolPacks names the newest version's work files.

Acceptance

  • downloads/ and downloads on every step kind (at most 5); names, types and limits in @aivopod/shared (downloads.ts), byte check checkDownload in @aivopod/shared/zip: real .xlsx without macros, external links, embeddings, ActiveX; CSV UTF-8/Windows-1252 without NUL
  • SDK invalid-downloads; packtools download.* errors, download.unknown, warning downloadUnused, downloads.json + assets/<hash>
  • migration 0102: pack_downloads, step_events (tenant RLS), store_pack with work files; install and publish re-check
  • files under downloads/<hash>.<ext> in the asset volume, never served by the assets host
  • routes with attachment, Content-Security-Policy: sandbox, private, no-store; foreign enrollment and steps that don't hand the file out → 404
  • step_events with a 10 s dedupe; export records download and help in „Meine Daten“ and the teacher export; retention through the person cascade
  • archive format 57 (+ upgrade 56→57, format-1 fixture still imports)
  • UI: links above the task with the „Bearbeitung aktivieren“ sentence; work files in the teacher's pack list; „Was die Plattform aufzeichnet“
  • tests: shared (validator, schema fixtures), SDK, packtools, API integration (routes/downloads.test.ts, full suite 1132 green locally), browser test of the step
  • Playwright e2e for download + export: not in this PR. The API integration test covers the export rows; e2e follows with the pack (TK08), which brings a real pack with work files

🤖 Generated with Claude Code

https://claude.ai/code/session_01PVUe4i6vEUY3kHe9imoS6j

TK05 (Plan 26, Teil AZ, D515): work files of packs. Stacked on #634 (skills pin); merge that first. Deviation from the plan, recorded in D515 and SPEC Abschnitt 5 „Arbeitsdateien“: - The student route carries the step: `GET /api/assignments/:assignmentId/steps/:stepId/downloads/:name`. The log needs the step, and the route hands out only what that step names. - No separate list route for teachers: `schoolPacks` names the newest version's work files. Acceptance - [x] `downloads/` and `downloads` on every step kind (at most 5); names, types and limits in `@aivopod/shared` (`downloads.ts`), byte check `checkDownload` in `@aivopod/shared/zip`: real `.xlsx` without macros, external links, embeddings, ActiveX; CSV UTF-8/Windows-1252 without NUL - [x] SDK `invalid-downloads`; packtools `download.*` errors, `download.unknown`, warning `downloadUnused`, `downloads.json` + `assets/<hash>` - [x] migration 0102: `pack_downloads`, `step_events` (tenant RLS), `store_pack` with work files; install and publish re-check - [x] files under `downloads/<hash>.<ext>` in the asset volume, never served by the assets host - [x] routes with `attachment`, `Content-Security-Policy: sandbox`, `private, no-store`; foreign enrollment and steps that don't hand the file out → 404 - [x] `step_events` with a 10 s dedupe; export records `download` and `help` in „Meine Daten“ and the teacher export; retention through the person cascade - [x] archive format 57 (+ upgrade 56→57, format-1 fixture still imports) - [x] UI: links above the task with the „Bearbeitung aktivieren“ sentence; work files in the teacher's pack list; „Was die Plattform aufzeichnet“ - [x] tests: shared (validator, schema fixtures), SDK, packtools, API integration (`routes/downloads.test.ts`, full suite 1132 green locally), browser test of the step - [ ] Playwright e2e for download + export: not in this PR. The API integration test covers the export rows; e2e follows with the pack (TK08), which brings a real pack with work files 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01PVUe4i6vEUY3kHe9imoS6j
TK04: @aivopod/skills 1.5.0 – sheets.cells and sheets.types (Plan 26, D518)
All checks were successful
check / check (pull_request) Successful in 14m0s
e2e / e2e (pull_request) Successful in 26m14s
publish / release (push) Successful in 2m46s
check / check (push) Successful in 17m2s
e2e / e2e (push) Successful in 28m3s
7b48291740
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PVUe4i6vEUY3kHe9imoS6j
TK05: work files of packs – downloads/, step field downloads, served by the API and logged (Plan 26, D515)
Some checks failed
check / check (pull_request) Failing after 15m43s
e2e / e2e (pull_request) Has been cancelled
98ff9f39ff
- shared: downloads.ts (names, types, downloads.json, limits); checkDownload in
  @aivopod/shared/zip: a real .xlsx without macros, external links, embedded
  objects or ActiveX; CSV as UTF-8 or Windows-1252 without NUL. StepRef and the
  authoring step get `downloads` (at most five per step).
- SDK: validates `downloads` (invalid-downloads), the manifest names them.
- packtools: reads downloads/ with the same check, download.unknown for a name
  no file has, warning downloadUnused, downloads.json and assets/<hash>.
- API: migration 0102 (pack_downloads, step_events, store_pack with the work
  files); install and publish read and re-check them, stored under
  downloads/<hash>.<ext>, which the assets host never serves. Routes
  GET /api/assignments/:id/steps/:stepId/downloads/:name (own assignment, the
  version she works with, only what the step hands out; logged once per 10 s)
  and GET /api/teacher/packs/:packId/downloads/:name; attachment, sandbox,
  private no-store. schoolPacks lists the newest version's work files.
- Export: records download and help in „Meine Daten“ and the teacher's export;
  archive format 57 carries pack_downloads and step_events.
- Web: links above the task with the sentence about Excel's protected view;
  work files on the teacher's pack list; „Was die Plattform aufzeichnet“.
- SPEC section 5 „Arbeitsdateien“, section 3 export records, D515 refined.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PVUe4i6vEUY3kHe9imoS6j
TK05: browser tests know the work files – pack list and the recorded list
Some checks failed
check / check (pull_request) Successful in 16m54s
e2e / e2e (pull_request) Successful in 25m37s
publish / release (push) Successful in 2m10s
check / check (push) Has been cancelled
e2e / e2e (push) Has been cancelled
d736d95a3c
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PVUe4i6vEUY3kHe9imoS6j
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
aivopod/aivopod-app!635
No description provided.