diff --git a/.gitignore b/.gitignore index 431ffbf..aa35b9b 100644 --- a/.gitignore +++ b/.gitignore @@ -175,7 +175,6 @@ templates /prepared /Lab9_out* *.fish -!scripts/update-notes.fish .scriptmark_extracted/ .remember/ tests/geec/ @@ -183,11 +182,11 @@ tests_submission/ # P-669 test fixtures — the broad rules above (*.csv, submissions, templates, config.toml) # must not swallow committed test data. -!crates/scriptmark/tests/fixtures/** +!src/crates/scriptmark/tests/fixtures/** # ...but not what running the suite over them produces. -crates/scriptmark/tests/fixtures/**/__pycache__/ -crates/scriptmark/tests/fixtures/**/.scriptmark_extracted/ -crates/scriptmark/tests/fixtures/**/.DS_Store +src/crates/scriptmark/tests/fixtures/**/__pycache__/ +src/crates/scriptmark/tests/fixtures/**/.scriptmark_extracted/ +src/crates/scriptmark/tests/fixtures/**/.DS_Store # P-674 example bundles ship their students; `submissions` above would drop them. !examples/bundles/*/submissions/ diff --git a/CLAUDE.md b/CLAUDE.md index 80e2e5c..1dc98ff 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -7,30 +7,39 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co `CLAUDE.md` is the canonical project instruction file; `AGENTS.md` and `.github/copilot-instructions.md` are symlinks to it. -- Documentation is in the `notes/` git submodule: +- Public documentation belongs in `docs/`. Private documentation is in the `notes/` git submodule: `https://github.com/Acture/obsidian-vault.git`, branch `project/scriptmark`. Start at `notes/README.md`; the teacher contract is `notes/docs/test-bundles.md`, and plans are in - `notes/docs/plans/`. Do not recreate a maintained root `docs/` tree. + `notes/docs/plans/`. Do not copy private notes into the public documentation tree. + The project branch root contains only this project's notes; the vault's `master` + places them under `scriptmark/`. Keep shared automation and vault configuration on master. - Default to the latest remote `project/scriptmark` notes. At the start of every - session, after pulling code, and before reading or editing notes, run - `fish scripts/update-notes.fish` from this repository. This initializes missing - notes, fetches the configured project branch, fast-forwards it and leaves that branch - checked out. It handles single-branch clones. Never assume the gitlink is the latest. + session, after pulling code, and before reading or editing notes, follow the native + Git update sequence in README's "Documentation and checkout" section. It explicitly + fetches the project branch, checks for local work, switches to `project/scriptmark` + and fast-forwards it. It handles single-branch clones. Never assume the gitlink is latest. - Clone with `git clone https://github.com/Acture/scriptmark.git`, enter the clone, - then run the same helper. It stops on local notes edits, unpushed commits or divergence; - preserve and reconcile them instead of resetting or force-pushing. If fetching fails, - report that the latest notes were not verified; do not silently describe stale notes as current. -- Edit only `notes/`. A newer notes checkout can make the parent's gitlink + then initialize with `git submodule update --init --remote --no-single-branch -- notes` + and `git -C notes switch project/scriptmark`. For existing notes, use the guarded + update sequence instead. Stop on local edits, unpushed commits or divergence; preserve + and reconcile them instead of resetting or force-pushing. If fetching fails, report + that the latest notes were not verified; do not describe stale notes as current. + Shared synchronization and submission tooling belongs to the notes repository; + do not add a project-local notes updater. +- Edit private documentation only in `notes/`. A newer notes checkout can make the parent's gitlink dirty; review `git diff --submodule=log -- notes` and include the updated reference in the next code commit. Do not reset notes just to remove that expected difference. - The gitlink remains a concrete saved checkpoint because Git requires one. Use `git submodule update --init --checkout -- notes` only for an explicitly requested historical reproduction, with clean notes. Pinned checkout is not the daily workflow. -- Stage with `git -C notes add README.md`, commit in `notes`, and push with - `python3 (git -C notes rev-parse --path-format=absolute --git-common-dir)/hooks/notes-boundary/submit_project.py --repo notes`. Only after that push - succeeds, stage `notes` in this repository and commit/push its new gitlink. A failed - push must never leave a published parent pointer to unavailable notes. +- Stage specific documents in `notes/` and commit there. Publish with the master-owned + `hooks/notes-boundary/submit_project.py --repo notes` under the notes repository's + common Git directory; it runs the required remote check before pushing that SHA. + The remote requires `notes-boundary/root/scriptmark` from GitHub Actions. + Install/update this helper from the notes repository's trusted `origin/master` as + shown in README. Direct pushes of unchecked commits are rejected. Only after a + successful submission, stage `notes` here and commit/push its new gitlink. - The README contains the complete command sequence. Keep original histories and resolve divergence without overwriting either side. - Linear is the execution home. Keep runnable examples, code, measurements and raw @@ -62,6 +71,11 @@ default Python is newer than the PyO3 version supports; see the P-676 validation Single `scriptmark` crate (lib + bin) with `scriptmark-py` as separate cdylib for PyO3. +All product source is under `src/`: Rust packages live in `src/crates/` and the +Python package entry point in `src/python/scriptmark/`. Workspace/build configuration +stays at the repository root, where Cargo and Maturin commands are run. The module +paths below are relative to `src/crates/scriptmark/src/`. + Data flows: TOML specs + student files → Runner → grading record (evidence + score revisions) → Display/DB/HTML/Canvas. `rescore` adds a revision from saved evidence. @@ -96,21 +110,21 @@ Zero and withheld grades stay distinct. See the notes' teacher contract for poli ## Critical Files -- `crates/scriptmark/src/runner/python.rs` — PythonExecutor + embedded helper scripts (HELPER_SCRIPT, CHAIN_HELPER_SCRIPT). Contains import allowlist, env sanitization, `sandboxed_cmd()`, `spawn_with_timeout()`. -- `crates/scriptmark/src/runner/sandbox.rs` — SandboxConfig + setrlimit application. Platform-conditional: RLIMIT_AS skipped on macOS, RLIMIT_* constants differ between Linux (c_uint) and macOS (c_int). -- `crates/scriptmark/src/runner/orchestrator.rs` — Runs vars→setup→expand→oracle→execute pipeline per student, tokio parallel. -- `crates/scriptmark/src/models/spec.rs` — All TOML spec structs (TestSpec, TestCase, SetupStep, Parametrize, Oracle, LintConfig, CheckMethod). -- `crates/scriptmark/src/discovery.rs` — File discovery + ZIP archive extraction with size/count limits. -- `crates/scriptmark/src/record.rs` — The grading record every consumer reads (`--output`): evidence with submission/spec fingerprints, append-only score revisions, `check()` refusing evidence whose tests, submissions or matching changed. -- `crates/scriptmark/src/grading.rs` — GradingPolicy dispatch (templates + Rhai formulas). -- `crates/scriptmark/src/main.rs` — All CLI command handlers. -- `crates/scriptmark-py/src/lib.rs` — PyO3 bindings: grade(), run(), discover(), load_spec(), StudentResult, TestSpec classes. +- `src/crates/scriptmark/src/runner/python.rs` — PythonExecutor + embedded helper scripts (HELPER_SCRIPT, CHAIN_HELPER_SCRIPT). Contains import allowlist, env sanitization, `sandboxed_cmd()`, `spawn_with_timeout()`. +- `src/crates/scriptmark/src/runner/sandbox.rs` — SandboxConfig + setrlimit application. Platform-conditional: RLIMIT_AS skipped on macOS, RLIMIT_* constants differ between Linux (c_uint) and macOS (c_int). +- `src/crates/scriptmark/src/runner/orchestrator.rs` — Runs vars→setup→expand→oracle→execute pipeline per student, tokio parallel. +- `src/crates/scriptmark/src/models/spec.rs` — All TOML spec structs (TestSpec, TestCase, SetupStep, Parametrize, Oracle, LintConfig, CheckMethod). +- `src/crates/scriptmark/src/discovery.rs` — File discovery + ZIP archive extraction with size/count limits. +- `src/crates/scriptmark/src/record.rs` — The grading record every consumer reads (`--output`): evidence with submission/spec fingerprints, append-only score revisions, `check()` refusing evidence whose tests, submissions or matching changed. +- `src/crates/scriptmark/src/grading.rs` — GradingPolicy dispatch (templates + Rhai formulas). +- `src/crates/scriptmark/src/main.rs` — All CLI command handlers. +- `src/crates/scriptmark-py/src/lib.rs` — PyO3 bindings: grade(), run(), discover(), load_spec(), StudentResult, TestSpec classes. ## Conventions - Workspace dependencies in root `Cargo.toml`, crates reference with `{ workspace = true }` - `thiserror` for library error types, `anyhow` for CLI/binary error handling -- All checkers implement `Checker` trait in `crates/scriptmark/src/checker/mod.rs` +- All checkers implement `Checker` trait in `src/crates/scriptmark/src/checker/mod.rs` - Integration tests spawn real Python processes — need `python3` available - `scriptmark-py` has `publish = false` (cdylib, distributed via PyPI/maturin, not crates.io) - Platform-specific code uses `#[cfg(target_os = "macos")]` / `#[cfg(target_os = "linux")]` for rlimit types @@ -150,19 +164,3 @@ seed = 42 [cases.parametrize.oracle] rhai = "if a >= b { a } else { b }" ``` - - -## Project notes submission - -`docs/` is reserved for public documentation. Private research notes live in `notes/`, which tracks `project/scriptmark` in `Acture/obsidian-vault`; start at `notes/README.md`. This checkout's root contains only this project's notes. Master places these notes under `scriptmark/`. Keep automation and vault configuration on master. Preserve existing local edits when updating a checkout. - -Install or refresh the trusted submission tools in Git metadata, including in new clones: - -```fish -git -C notes fetch origin refs/heads/master:refs/remotes/origin/master -set notes_common_gitdir (git -C notes rev-parse --path-format=absolute --git-common-dir) -git -C notes show origin/master:.github/scripts/install_push_hook.py > "$notes_common_gitdir/install_push_hook.py" -python3 "$notes_common_gitdir/install_push_hook.py" --repo notes --source-ref origin/master -``` - -After committing specific note files, submit through `python3 "$notes_common_gitdir/hooks/notes-boundary/submit_project.py" --repo notes`. The remote requires `notes-boundary/root/scriptmark` from GitHub Actions. Only after successful submission should this repository commit and push the `notes` gitlink. See the central repository's `项目接入.md` for initialization, updates and conflict handling. diff --git a/Cargo.toml b/Cargo.toml index ddac70d..9ca5f12 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,8 +1,8 @@ [workspace] resolver = "2" members = [ - "crates/scriptmark", - "crates/scriptmark-py", + "src/crates/scriptmark", + "src/crates/scriptmark-py", ] [workspace.package] diff --git a/README.md b/README.md index 51d4fc5..9f062f1 100644 --- a/README.md +++ b/README.md @@ -7,36 +7,62 @@ Automated grading CLI for student programming assignments. Rust core, TOML test specifications, Python bindings via PyO3. +## Repository layout + +```text +src/ + crates/ + scriptmark/ Rust library, CLI and integration tests + scriptmark-py/ Rust bindings for the Python extension + python/ + scriptmark/ Python package entry point +examples/ Runnable teacher test bundles +notes/ Private project documentation submodule +``` + +Run Cargo and Maturin commands from the repository root. `Cargo.toml` and +`pyproject.toml` configure both builds; the compiled Python extension is packaged +with `src/python/scriptmark/`. + ## Documentation and checkout -Project documentation lives in +Public documentation belongs in `docs/`. Private project documentation lives in [Acture/obsidian-vault, branch `project/scriptmark`](https://github.com/Acture/obsidian-vault/tree/project/scriptmark), mounted here as the `notes/` submodule. Start with -[the project index](https://github.com/Acture/obsidian-vault/blob/project/scriptmark/scriptmark/README.md) +[the project index](https://github.com/Acture/obsidian-vault/blob/project/scriptmark/README.md) or open `notes/README.md` locally. The teacher guide is `notes/docs/test-bundles.md`; design records are under `notes/docs/plans/`. Access to the notes repository is required to initialize it. +Building and using ScriptMark does not require access to private notes. -Daily work uses the latest `project/scriptmark` notes. Clone, then initialize/update -the notes and attach their project branch: +Daily work uses the latest `project/scriptmark` notes through Git's native submodule +commands. In a new clone, initialize the notes and attach their project branch: ```fish git clone https://github.com/Acture/scriptmark.git -cd scriptmark -fish scripts/update-notes.fish +and cd scriptmark +and git submodule update --init --remote --no-single-branch -- notes +and git -C notes switch project/scriptmark ``` At the start of each work session, after pulling code changes, and before reading or -editing notes, use the same command: +editing an existing notes checkout, update it from the project branch: ```fish -fish scripts/update-notes.fish +git -C notes -c fetch.prune=false -c fetch.pruneTags=false fetch --no-tags origin refs/heads/project/scriptmark:refs/remotes/origin/project/scriptmark +and test (git -C notes status --porcelain | count) -eq 0 +and git -C notes merge-base --is-ancestor HEAD origin/project/scriptmark +and git -C notes switch project/scriptmark +and git -C notes merge-base --is-ancestor HEAD origin/project/scriptmark +and git -C notes merge --ff-only origin/project/scriptmark ``` -The helper fetches the configured project branch, fast-forwards it and leaves it -checked out for editing. It also works after a single-branch clone. Local edits, -unpushed commits and divergence stop the update so they can be preserved and resolved. -If fetching fails, the checkout has not been confirmed current. +The explicit fetch also works with a single-branch notes clone. The checks before +and after switching preserve unpublished work both at the current HEAD and on an +existing local project branch. A failed command stops the sequence: inspect +`git -C notes status` and `git -C notes log --oneline origin/project/scriptmark..HEAD`, +then preserve and reconcile local edits, unpushed commits or divergence. Do not skip +the checks or reset the notes. If fetching fails, the checkout is not confirmed current. Git still records a concrete submodule commit in each code commit. That is a saved checkpoint, not the daily reading policy; newer notes normally make `git status` show @@ -49,20 +75,36 @@ git commit -m "docs: update ScriptMark notes" git push ``` -To edit documentation, update first, then publish the notes before the parent reference: +Before the first documentation push in a clone, install the trusted boundary checker +from the notes repository's `master`. Repeat this when its submission tooling changes: + +```fish +git -C notes -c fetch.prune=false -c fetch.pruneTags=false fetch --no-tags origin refs/heads/master:refs/remotes/origin/master +and set notes_common_gitdir (git -C notes rev-parse --path-format=absolute --git-common-dir) +and git -C notes show origin/master:.github/scripts/install_push_hook.py > "$notes_common_gitdir/install_push_hook.py" +and python3 "$notes_common_gitdir/install_push_hook.py" --repo notes --source-ref origin/master +``` + +To edit documentation, complete the update sequence above first, then publish the +notes before the parent reference: ```fish -fish scripts/update-notes.fish -# Edit notes/; inspect the changes before staging. -git -C notes diff -- scriptmark/ +# Edit project documents directly in notes/; stage the specific files changed. +git -C notes diff git -C notes add README.md git -C notes commit -m "docs(scriptmark): describe the change" -python3 (git -C notes rev-parse --path-format=absolute --git-common-dir)/hooks/notes-boundary/submit_project.py --repo notes +set notes_common_gitdir (git -C notes rev-parse --path-format=absolute --git-common-dir) +python3 "$notes_common_gitdir/hooks/notes-boundary/submit_project.py" --repo notes and git add notes and git commit -m "docs: update ScriptMark notes" and git push ``` +The submission helper runs the required remote boundary check and pushes the checked +commit. A direct push of an unchecked commit is rejected. The notes repository's +[project instructions](https://github.com/Acture/obsidian-vault/blob/master/项目接入.md) +own this workflow. + Push the notes successfully **before** updating the code repository's gitlink. If a fast-forward fails, resolve the divergence while preserving both versions. Do not force-push or discard notes. Runtime code, examples and artifacts stay in this repository; @@ -71,7 +113,9 @@ documentation edits belong on the notes branch. Only when explicitly reproducing an older code revision, restore its recorded notes with `git submodule update --init --checkout -- notes` from a clean notes checkout. Ordinary `git clone --recurse-submodules` uses that recorded checkpoint too; run the -helper afterwards for current notes. Git has no floating gitlink that advances by itself. +update sequence above afterwards for current notes. Git has no floating gitlink that +advances by itself. Shared notes tooling and its maintenance belong to the notes +repository; ScriptMark does not carry its own synchronization script. ## Installation @@ -199,7 +243,7 @@ print(spec.name, spec.function, spec.num_cases) Teachers can configure student ownership, item file patterns, function aliases and per-student overrides in `assignment.toml`. Preview decisions and candidates with `scriptmark match`; unresolved conflicts withhold grades. See -[matching rules](https://github.com/Acture/obsidian-vault/blob/project/scriptmark/scriptmark/docs/matching.md). +[matching rules](https://github.com/Acture/obsidian-vault/blob/project/scriptmark/docs/matching.md). ```toml [meta] @@ -247,7 +291,7 @@ Reference answers are computed before grading and frozen for reuse. `--replay` v their sources and configuration, then reuses the answers without recomputing them. References can also supply declared exceptions, stdout and text files; see the [reference bundle](examples/bundles/reference_oracle) and -[answer contract](https://github.com/Acture/obsidian-vault/blob/project/scriptmark/scriptmark/docs/test-bundles.md#reference-implementations). +[answer contract](https://github.com/Acture/obsidian-vault/blob/project/scriptmark/docs/test-bundles.md#reference-implementations). Every case runs in its own process and working directory. When state should carry over — an object built once and driven step by step — say so with a scenario: @@ -278,7 +322,7 @@ expect = 150 Anything a bundle cannot honour — an unknown field, a checker that does not exist, a case with nothing to judge — is refused before a single student runs. Every failure says whose it is: the student's, the teacher's, or the machine's. See -[the teacher guide](https://github.com/Acture/obsidian-vault/blob/project/scriptmark/scriptmark/docs/test-bundles.md) for the full contract, and +[the teacher guide](https://github.com/Acture/obsidian-vault/blob/project/scriptmark/docs/test-bundles.md) for the full contract, and [examples/bundles](examples/bundles) for a pure function, a shared object and file I/O. ### Scoring @@ -305,7 +349,7 @@ points = 3 aggregation = "proportional" # points × pass rate; or "all_or_nothing" ``` -See [the scoring contract](https://github.com/Acture/obsidian-vault/blob/project/scriptmark/scriptmark/docs/test-bundles.md#scoring) for every rule. +See [the scoring contract](https://github.com/Acture/obsidian-vault/blob/project/scriptmark/docs/test-bundles.md#scoring) for every rule. ### Checkers @@ -323,7 +367,7 @@ See [the scoring contract](https://github.com/Acture/obsidian-vault/blob/project ## Features - **Custom test engine** -- subprocess execution, no pytest dependency -- **Isolated units** -- a process and directory per case, env isolation, import allowlist, setrlimit, timeout with kill; contains accidents, not a security sandbox ([details](https://github.com/Acture/obsidian-vault/blob/project/scriptmark/scriptmark/docs/test-bundles.md#what-grading-does-not-defend-against)) +- **Isolated units** -- a process and directory per case, env isolation, import allowlist, setrlimit, timeout with kill; contains accidents, not a security sandbox ([details](https://github.com/Acture/obsidian-vault/blob/project/scriptmark/docs/test-bundles.md#what-grading-does-not-defend-against)) - **Parallel** -- tokio orchestrator, grades 80+ students in seconds - **Parametrize + oracle** -- random inputs with teacher reference implementations - **Per-item scoring** -- declared points and aggregation; zero and withheld kept apart in every export diff --git a/pyproject.toml b/pyproject.toml index 6e6f847..7d3f31e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,5 +22,5 @@ classifiers = [ [tool.maturin] features = ["pyo3/extension-module"] module-name = "scriptmark._scriptmark" -manifest-path = "crates/scriptmark-py/Cargo.toml" -python-source = "python" +manifest-path = "src/crates/scriptmark-py/Cargo.toml" +python-source = "src/python" diff --git a/scripts/update-notes.fish b/scripts/update-notes.fish deleted file mode 100755 index b5f7b9e..0000000 --- a/scripts/update-notes.fish +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env fish - -# Daily notes follow the configured project branch; the gitlink is a saved checkpoint. -set -l script_dir (status dirname) -set -l repo_root (path resolve "$script_dir/..") -set -l notes_path "$repo_root/notes" -set -l branch (git -C "$repo_root" config -f .gitmodules --get submodule.notes.branch) -or exit 1 - -if not test -e "$notes_path/.git" - git -C "$repo_root" submodule sync -- notes - or exit 1 - git -C "$repo_root" submodule update --init --remote --no-single-branch -- notes - or exit 1 -end - -set -l changes (git -C "$notes_path" status --porcelain) -or exit 1 -if test (count $changes) -gt 0 - printf '%s\n' 'Notes have local changes. Commit or preserve them before updating.' >&2 - exit 1 -end - -# A single-branch clone may otherwise fetch only the vault's default branch. -git -C "$notes_path" remote set-branches origin "$branch" -or exit 1 -git -C "$notes_path" -c fetch.prune=false -c fetch.pruneTags=false fetch origin -or exit 1 - -if not git -C "$notes_path" merge-base --is-ancestor HEAD "origin/$branch" - printf '%s\n' "Notes HEAD has commits outside origin/$branch. Preserve and reconcile them before updating." >&2 - exit 1 -end - -if git -C "$notes_path" show-ref --verify --quiet "refs/heads/$branch" - if not git -C "$notes_path" merge-base --is-ancestor "$branch" "origin/$branch" - printf '%s\n' "Local $branch has unpushed or divergent commits. Publish or reconcile them before updating." >&2 - exit 1 - end - git -C "$notes_path" switch "$branch" -else - git -C "$notes_path" switch --create "$branch" --track "origin/$branch" -end -or exit 1 - -git -C "$notes_path" merge --ff-only "origin/$branch" -or exit 1 -printf 'Notes: %s @ %s\n' "$branch" (git -C "$notes_path" rev-parse --short HEAD) diff --git a/crates/scriptmark-py/Cargo.toml b/src/crates/scriptmark-py/Cargo.toml similarity index 100% rename from crates/scriptmark-py/Cargo.toml rename to src/crates/scriptmark-py/Cargo.toml diff --git a/crates/scriptmark-py/src/lib.rs b/src/crates/scriptmark-py/src/lib.rs similarity index 100% rename from crates/scriptmark-py/src/lib.rs rename to src/crates/scriptmark-py/src/lib.rs diff --git a/crates/scriptmark/Cargo.toml b/src/crates/scriptmark/Cargo.toml similarity index 97% rename from crates/scriptmark/Cargo.toml rename to src/crates/scriptmark/Cargo.toml index 509bb03..6925fa5 100644 --- a/crates/scriptmark/Cargo.toml +++ b/src/crates/scriptmark/Cargo.toml @@ -9,7 +9,7 @@ repository.workspace = true homepage.workspace = true keywords.workspace = true categories.workspace = true -readme = "../../README.md" +readme = "../../../README.md" [[bin]] name = "scriptmark" diff --git a/crates/scriptmark/src/archive.rs b/src/crates/scriptmark/src/archive.rs similarity index 100% rename from crates/scriptmark/src/archive.rs rename to src/crates/scriptmark/src/archive.rs diff --git a/crates/scriptmark/src/assignment.rs b/src/crates/scriptmark/src/assignment.rs similarity index 100% rename from crates/scriptmark/src/assignment.rs rename to src/crates/scriptmark/src/assignment.rs diff --git a/crates/scriptmark/src/canvas/bundle.rs b/src/crates/scriptmark/src/canvas/bundle.rs similarity index 100% rename from crates/scriptmark/src/canvas/bundle.rs rename to src/crates/scriptmark/src/canvas/bundle.rs diff --git a/crates/scriptmark/src/canvas/client.rs b/src/crates/scriptmark/src/canvas/client.rs similarity index 100% rename from crates/scriptmark/src/canvas/client.rs rename to src/crates/scriptmark/src/canvas/client.rs diff --git a/crates/scriptmark/src/canvas/mod.rs b/src/crates/scriptmark/src/canvas/mod.rs similarity index 100% rename from crates/scriptmark/src/canvas/mod.rs rename to src/crates/scriptmark/src/canvas/mod.rs diff --git a/crates/scriptmark/src/checker/builtin.rs b/src/crates/scriptmark/src/checker/builtin.rs similarity index 100% rename from crates/scriptmark/src/checker/builtin.rs rename to src/crates/scriptmark/src/checker/builtin.rs diff --git a/crates/scriptmark/src/checker/mod.rs b/src/crates/scriptmark/src/checker/mod.rs similarity index 100% rename from crates/scriptmark/src/checker/mod.rs rename to src/crates/scriptmark/src/checker/mod.rs diff --git a/crates/scriptmark/src/checker/python_checker.rs b/src/crates/scriptmark/src/checker/python_checker.rs similarity index 100% rename from crates/scriptmark/src/checker/python_checker.rs rename to src/crates/scriptmark/src/checker/python_checker.rs diff --git a/crates/scriptmark/src/checker/rhai_checker.rs b/src/crates/scriptmark/src/checker/rhai_checker.rs similarity index 100% rename from crates/scriptmark/src/checker/rhai_checker.rs rename to src/crates/scriptmark/src/checker/rhai_checker.rs diff --git a/crates/scriptmark/src/db/mod.rs b/src/crates/scriptmark/src/db/mod.rs similarity index 100% rename from crates/scriptmark/src/db/mod.rs rename to src/crates/scriptmark/src/db/mod.rs diff --git a/crates/scriptmark/src/db/queries.rs b/src/crates/scriptmark/src/db/queries.rs similarity index 100% rename from crates/scriptmark/src/db/queries.rs rename to src/crates/scriptmark/src/db/queries.rs diff --git a/crates/scriptmark/src/db/results.rs b/src/crates/scriptmark/src/db/results.rs similarity index 100% rename from crates/scriptmark/src/db/results.rs rename to src/crates/scriptmark/src/db/results.rs diff --git a/crates/scriptmark/src/db/roster.rs b/src/crates/scriptmark/src/db/roster.rs similarity index 100% rename from crates/scriptmark/src/db/roster.rs rename to src/crates/scriptmark/src/db/roster.rs diff --git a/crates/scriptmark/src/db/schema.rs b/src/crates/scriptmark/src/db/schema.rs similarity index 100% rename from crates/scriptmark/src/db/schema.rs rename to src/crates/scriptmark/src/db/schema.rs diff --git a/crates/scriptmark/src/discovery.rs b/src/crates/scriptmark/src/discovery.rs similarity index 100% rename from crates/scriptmark/src/discovery.rs rename to src/crates/scriptmark/src/discovery.rs diff --git a/crates/scriptmark/src/display.rs b/src/crates/scriptmark/src/display.rs similarity index 100% rename from crates/scriptmark/src/display.rs rename to src/crates/scriptmark/src/display.rs diff --git a/crates/scriptmark/src/export.rs b/src/crates/scriptmark/src/export.rs similarity index 100% rename from crates/scriptmark/src/export.rs rename to src/crates/scriptmark/src/export.rs diff --git a/crates/scriptmark/src/grading.rs b/src/crates/scriptmark/src/grading.rs similarity index 100% rename from crates/scriptmark/src/grading.rs rename to src/crates/scriptmark/src/grading.rs diff --git a/crates/scriptmark/src/input/canvas.rs b/src/crates/scriptmark/src/input/canvas.rs similarity index 100% rename from crates/scriptmark/src/input/canvas.rs rename to src/crates/scriptmark/src/input/canvas.rs diff --git a/crates/scriptmark/src/input/mod.rs b/src/crates/scriptmark/src/input/mod.rs similarity index 100% rename from crates/scriptmark/src/input/mod.rs rename to src/crates/scriptmark/src/input/mod.rs diff --git a/crates/scriptmark/src/lib.rs b/src/crates/scriptmark/src/lib.rs similarity index 100% rename from crates/scriptmark/src/lib.rs rename to src/crates/scriptmark/src/lib.rs diff --git a/crates/scriptmark/src/main.rs b/src/crates/scriptmark/src/main.rs similarity index 100% rename from crates/scriptmark/src/main.rs rename to src/crates/scriptmark/src/main.rs diff --git a/crates/scriptmark/src/matching.py b/src/crates/scriptmark/src/matching.py similarity index 100% rename from crates/scriptmark/src/matching.py rename to src/crates/scriptmark/src/matching.py diff --git a/crates/scriptmark/src/matching.rs b/src/crates/scriptmark/src/matching.rs similarity index 100% rename from crates/scriptmark/src/matching.rs rename to src/crates/scriptmark/src/matching.rs diff --git a/crates/scriptmark/src/models/config.rs b/src/crates/scriptmark/src/models/config.rs similarity index 100% rename from crates/scriptmark/src/models/config.rs rename to src/crates/scriptmark/src/models/config.rs diff --git a/crates/scriptmark/src/models/mod.rs b/src/crates/scriptmark/src/models/mod.rs similarity index 100% rename from crates/scriptmark/src/models/mod.rs rename to src/crates/scriptmark/src/models/mod.rs diff --git a/crates/scriptmark/src/models/result.rs b/src/crates/scriptmark/src/models/result.rs similarity index 100% rename from crates/scriptmark/src/models/result.rs rename to src/crates/scriptmark/src/models/result.rs diff --git a/crates/scriptmark/src/models/spec.rs b/src/crates/scriptmark/src/models/spec.rs similarity index 100% rename from crates/scriptmark/src/models/spec.rs rename to src/crates/scriptmark/src/models/spec.rs diff --git a/crates/scriptmark/src/models/submission.rs b/src/crates/scriptmark/src/models/submission.rs similarity index 100% rename from crates/scriptmark/src/models/submission.rs rename to src/crates/scriptmark/src/models/submission.rs diff --git a/crates/scriptmark/src/record.rs b/src/crates/scriptmark/src/record.rs similarity index 100% rename from crates/scriptmark/src/record.rs rename to src/crates/scriptmark/src/record.rs diff --git a/crates/scriptmark/src/report.rs b/src/crates/scriptmark/src/report.rs similarity index 100% rename from crates/scriptmark/src/report.rs rename to src/crates/scriptmark/src/report.rs diff --git a/crates/scriptmark/src/report_template.html b/src/crates/scriptmark/src/report_template.html similarity index 100% rename from crates/scriptmark/src/report_template.html rename to src/crates/scriptmark/src/report_template.html diff --git a/crates/scriptmark/src/roster.rs b/src/crates/scriptmark/src/roster.rs similarity index 100% rename from crates/scriptmark/src/roster.rs rename to src/crates/scriptmark/src/roster.rs diff --git a/crates/scriptmark/src/runner/answers.rs b/src/crates/scriptmark/src/runner/answers.rs similarity index 100% rename from crates/scriptmark/src/runner/answers.rs rename to src/crates/scriptmark/src/runner/answers.rs diff --git a/crates/scriptmark/src/runner/executor.rs b/src/crates/scriptmark/src/runner/executor.rs similarity index 100% rename from crates/scriptmark/src/runner/executor.rs rename to src/crates/scriptmark/src/runner/executor.rs diff --git a/crates/scriptmark/src/runner/frozen.rs b/src/crates/scriptmark/src/runner/frozen.rs similarity index 100% rename from crates/scriptmark/src/runner/frozen.rs rename to src/crates/scriptmark/src/runner/frozen.rs diff --git a/crates/scriptmark/src/runner/generation.rs b/src/crates/scriptmark/src/runner/generation.rs similarity index 100% rename from crates/scriptmark/src/runner/generation.rs rename to src/crates/scriptmark/src/runner/generation.rs diff --git a/crates/scriptmark/src/runner/generator.rs b/src/crates/scriptmark/src/runner/generator.rs similarity index 100% rename from crates/scriptmark/src/runner/generator.rs rename to src/crates/scriptmark/src/runner/generator.rs diff --git a/crates/scriptmark/src/runner/harness.py b/src/crates/scriptmark/src/runner/harness.py similarity index 99% rename from crates/scriptmark/src/runner/harness.py rename to src/crates/scriptmark/src/runner/harness.py index 6910f21..4b4e223 100644 --- a/crates/scriptmark/src/runner/harness.py +++ b/src/crates/scriptmark/src/runner/harness.py @@ -355,7 +355,7 @@ def _removed_checker(*args, **kwargs): "@checker no longer binds a checker to a function: put " 'check = { function = "" } on each case it should judge ' "(https://github.com/Acture/obsidian-vault/blob/project/scriptmark/" - "scriptmark/docs/test-bundles.md#migrating-an-older-spec)" + "docs/test-bundles.md#migrating-an-older-spec)" ) diff --git a/crates/scriptmark/src/runner/judge.rs b/src/crates/scriptmark/src/runner/judge.rs similarity index 100% rename from crates/scriptmark/src/runner/judge.rs rename to src/crates/scriptmark/src/runner/judge.rs diff --git a/crates/scriptmark/src/runner/linter.rs b/src/crates/scriptmark/src/runner/linter.rs similarity index 100% rename from crates/scriptmark/src/runner/linter.rs rename to src/crates/scriptmark/src/runner/linter.rs diff --git a/crates/scriptmark/src/runner/mod.rs b/src/crates/scriptmark/src/runner/mod.rs similarity index 100% rename from crates/scriptmark/src/runner/mod.rs rename to src/crates/scriptmark/src/runner/mod.rs diff --git a/crates/scriptmark/src/runner/oracle.rs b/src/crates/scriptmark/src/runner/oracle.rs similarity index 100% rename from crates/scriptmark/src/runner/oracle.rs rename to src/crates/scriptmark/src/runner/oracle.rs diff --git a/crates/scriptmark/src/runner/orchestrator.rs b/src/crates/scriptmark/src/runner/orchestrator.rs similarity index 100% rename from crates/scriptmark/src/runner/orchestrator.rs rename to src/crates/scriptmark/src/runner/orchestrator.rs diff --git a/crates/scriptmark/src/runner/prepare.rs b/src/crates/scriptmark/src/runner/prepare.rs similarity index 100% rename from crates/scriptmark/src/runner/prepare.rs rename to src/crates/scriptmark/src/runner/prepare.rs diff --git a/crates/scriptmark/src/runner/python.rs b/src/crates/scriptmark/src/runner/python.rs similarity index 100% rename from crates/scriptmark/src/runner/python.rs rename to src/crates/scriptmark/src/runner/python.rs diff --git a/crates/scriptmark/src/runner/records.rs b/src/crates/scriptmark/src/runner/records.rs similarity index 100% rename from crates/scriptmark/src/runner/records.rs rename to src/crates/scriptmark/src/runner/records.rs diff --git a/crates/scriptmark/src/runner/sandbox.rs b/src/crates/scriptmark/src/runner/sandbox.rs similarity index 100% rename from crates/scriptmark/src/runner/sandbox.rs rename to src/crates/scriptmark/src/runner/sandbox.rs diff --git a/crates/scriptmark/src/similarity.rs b/src/crates/scriptmark/src/similarity.rs similarity index 100% rename from crates/scriptmark/src/similarity.rs rename to src/crates/scriptmark/src/similarity.rs diff --git a/crates/scriptmark/src/spec_loader.rs b/src/crates/scriptmark/src/spec_loader.rs similarity index 100% rename from crates/scriptmark/src/spec_loader.rs rename to src/crates/scriptmark/src/spec_loader.rs diff --git a/crates/scriptmark/src/tui/app.rs b/src/crates/scriptmark/src/tui/app.rs similarity index 100% rename from crates/scriptmark/src/tui/app.rs rename to src/crates/scriptmark/src/tui/app.rs diff --git a/crates/scriptmark/src/tui/mod.rs b/src/crates/scriptmark/src/tui/mod.rs similarity index 100% rename from crates/scriptmark/src/tui/mod.rs rename to src/crates/scriptmark/src/tui/mod.rs diff --git a/crates/scriptmark/src/tui/ui.rs b/src/crates/scriptmark/src/tui/ui.rs similarity index 100% rename from crates/scriptmark/src/tui/ui.rs rename to src/crates/scriptmark/src/tui/ui.rs diff --git a/crates/scriptmark/tests/canvas_fetch.rs b/src/crates/scriptmark/tests/canvas_fetch.rs similarity index 100% rename from crates/scriptmark/tests/canvas_fetch.rs rename to src/crates/scriptmark/tests/canvas_fetch.rs diff --git a/crates/scriptmark/tests/cli.rs b/src/crates/scriptmark/tests/cli.rs similarity index 100% rename from crates/scriptmark/tests/cli.rs rename to src/crates/scriptmark/tests/cli.rs diff --git a/crates/scriptmark/tests/examples.rs b/src/crates/scriptmark/tests/examples.rs similarity index 99% rename from crates/scriptmark/tests/examples.rs rename to src/crates/scriptmark/tests/examples.rs index 32a1a42..4d4ffcc 100644 --- a/crates/scriptmark/tests/examples.rs +++ b/src/crates/scriptmark/tests/examples.rs @@ -17,7 +17,7 @@ use scriptmark::runner::python::PythonExecutor; use scriptmark::spec_loader::{load_spec, load_specs_from_dir}; fn examples() -> PathBuf { - Path::new(env!("CARGO_MANIFEST_DIR")).join("../../examples") + Path::new(env!("CARGO_MANIFEST_DIR")).join("../../../examples") } async fn grade_example(name: &str) -> Vec { diff --git a/crates/scriptmark/tests/fixtures/archives/m3_default.rar b/src/crates/scriptmark/tests/fixtures/archives/m3_default.rar similarity index 100% rename from crates/scriptmark/tests/fixtures/archives/m3_default.rar rename to src/crates/scriptmark/tests/fixtures/archives/m3_default.rar diff --git a/crates/scriptmark/tests/fixtures/hw1/canvas/assignment.json b/src/crates/scriptmark/tests/fixtures/hw1/canvas/assignment.json similarity index 100% rename from crates/scriptmark/tests/fixtures/hw1/canvas/assignment.json rename to src/crates/scriptmark/tests/fixtures/hw1/canvas/assignment.json diff --git a/crates/scriptmark/tests/fixtures/hw1/canvas/files/1001/lab1.py b/src/crates/scriptmark/tests/fixtures/hw1/canvas/files/1001/lab1.py similarity index 100% rename from crates/scriptmark/tests/fixtures/hw1/canvas/files/1001/lab1.py rename to src/crates/scriptmark/tests/fixtures/hw1/canvas/files/1001/lab1.py diff --git a/crates/scriptmark/tests/fixtures/hw1/canvas/files/1002/draft.py b/src/crates/scriptmark/tests/fixtures/hw1/canvas/files/1002/draft.py similarity index 100% rename from crates/scriptmark/tests/fixtures/hw1/canvas/files/1002/draft.py rename to src/crates/scriptmark/tests/fixtures/hw1/canvas/files/1002/draft.py diff --git a/crates/scriptmark/tests/fixtures/hw1/canvas/files/1003/lab1.py b/src/crates/scriptmark/tests/fixtures/hw1/canvas/files/1003/lab1.py similarity index 100% rename from crates/scriptmark/tests/fixtures/hw1/canvas/files/1003/lab1.py rename to src/crates/scriptmark/tests/fixtures/hw1/canvas/files/1003/lab1.py diff --git a/crates/scriptmark/tests/fixtures/hw1/canvas/files/1004/lab1.py b/src/crates/scriptmark/tests/fixtures/hw1/canvas/files/1004/lab1.py similarity index 100% rename from crates/scriptmark/tests/fixtures/hw1/canvas/files/1004/lab1.py rename to src/crates/scriptmark/tests/fixtures/hw1/canvas/files/1004/lab1.py diff --git a/crates/scriptmark/tests/fixtures/hw1/canvas/files/1005/lab1.py b/src/crates/scriptmark/tests/fixtures/hw1/canvas/files/1005/lab1.py similarity index 100% rename from crates/scriptmark/tests/fixtures/hw1/canvas/files/1005/lab1.py rename to src/crates/scriptmark/tests/fixtures/hw1/canvas/files/1005/lab1.py diff --git a/crates/scriptmark/tests/fixtures/hw1/legacy_results.json b/src/crates/scriptmark/tests/fixtures/hw1/legacy_results.json similarity index 100% rename from crates/scriptmark/tests/fixtures/hw1/legacy_results.json rename to src/crates/scriptmark/tests/fixtures/hw1/legacy_results.json diff --git a/crates/scriptmark/tests/fixtures/hw1/local/roster.csv b/src/crates/scriptmark/tests/fixtures/hw1/local/roster.csv similarity index 100% rename from crates/scriptmark/tests/fixtures/hw1/local/roster.csv rename to src/crates/scriptmark/tests/fixtures/hw1/local/roster.csv diff --git a/crates/scriptmark/tests/fixtures/hw1/local/submissions/0024010003_lab1.py b/src/crates/scriptmark/tests/fixtures/hw1/local/submissions/0024010003_lab1.py similarity index 100% rename from crates/scriptmark/tests/fixtures/hw1/local/submissions/0024010003_lab1.py rename to src/crates/scriptmark/tests/fixtures/hw1/local/submissions/0024010003_lab1.py diff --git a/crates/scriptmark/tests/fixtures/hw1/local/submissions/2024010001_lab1.py b/src/crates/scriptmark/tests/fixtures/hw1/local/submissions/2024010001_lab1.py similarity index 100% rename from crates/scriptmark/tests/fixtures/hw1/local/submissions/2024010001_lab1.py rename to src/crates/scriptmark/tests/fixtures/hw1/local/submissions/2024010001_lab1.py diff --git a/crates/scriptmark/tests/fixtures/hw1/local/submissions/2024010002_lab1.py b/src/crates/scriptmark/tests/fixtures/hw1/local/submissions/2024010002_lab1.py similarity index 100% rename from crates/scriptmark/tests/fixtures/hw1/local/submissions/2024010002_lab1.py rename to src/crates/scriptmark/tests/fixtures/hw1/local/submissions/2024010002_lab1.py diff --git a/crates/scriptmark/tests/fixtures/hw1/local/submissions/2024010005_notes.txt b/src/crates/scriptmark/tests/fixtures/hw1/local/submissions/2024010005_notes.txt similarity index 100% rename from crates/scriptmark/tests/fixtures/hw1/local/submissions/2024010005_notes.txt rename to src/crates/scriptmark/tests/fixtures/hw1/local/submissions/2024010005_notes.txt diff --git a/crates/scriptmark/tests/fixtures/hw1/local/submissions/24010003_lab1.py b/src/crates/scriptmark/tests/fixtures/hw1/local/submissions/24010003_lab1.py similarity index 100% rename from crates/scriptmark/tests/fixtures/hw1/local/submissions/24010003_lab1.py rename to src/crates/scriptmark/tests/fixtures/hw1/local/submissions/24010003_lab1.py diff --git a/crates/scriptmark/tests/fixtures/hw1/local/submissions/_scratch_v2.py b/src/crates/scriptmark/tests/fixtures/hw1/local/submissions/_scratch_v2.py similarity index 100% rename from crates/scriptmark/tests/fixtures/hw1/local/submissions/_scratch_v2.py rename to src/crates/scriptmark/tests/fixtures/hw1/local/submissions/_scratch_v2.py diff --git a/crates/scriptmark/tests/generated.rs b/src/crates/scriptmark/tests/generated.rs similarity index 100% rename from crates/scriptmark/tests/generated.rs rename to src/crates/scriptmark/tests/generated.rs diff --git a/crates/scriptmark/tests/harness.rs b/src/crates/scriptmark/tests/harness.rs similarity index 100% rename from crates/scriptmark/tests/harness.rs rename to src/crates/scriptmark/tests/harness.rs diff --git a/crates/scriptmark/tests/input_equivalence.rs b/src/crates/scriptmark/tests/input_equivalence.rs similarity index 100% rename from crates/scriptmark/tests/input_equivalence.rs rename to src/crates/scriptmark/tests/input_equivalence.rs diff --git a/crates/scriptmark/tests/integration.rs b/src/crates/scriptmark/tests/integration.rs similarity index 100% rename from crates/scriptmark/tests/integration.rs rename to src/crates/scriptmark/tests/integration.rs diff --git a/crates/scriptmark/tests/matching.rs b/src/crates/scriptmark/tests/matching.rs similarity index 100% rename from crates/scriptmark/tests/matching.rs rename to src/crates/scriptmark/tests/matching.rs diff --git a/crates/scriptmark/tests/oracle.rs b/src/crates/scriptmark/tests/oracle.rs similarity index 100% rename from crates/scriptmark/tests/oracle.rs rename to src/crates/scriptmark/tests/oracle.rs diff --git a/crates/scriptmark/tests/record.rs b/src/crates/scriptmark/tests/record.rs similarity index 100% rename from crates/scriptmark/tests/record.rs rename to src/crates/scriptmark/tests/record.rs diff --git a/python/scriptmark/__init__.py b/src/python/scriptmark/__init__.py similarity index 100% rename from python/scriptmark/__init__.py rename to src/python/scriptmark/__init__.py