Repository navigation
Remove unused dev and research dependencies #1049
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| name: Python ${{ matrix.python-version }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.11", "3.12", "3.13"] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Set up Python | |
| uses: actions/setup-python@v7 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: pip | |
| - name: Install | |
| run: python -m pip install --upgrade pip && python -m pip install "uv==0.10.0" && python -m pip install -e ".[dev]" | |
| - name: Verify dependency lock | |
| run: uv lock --check --python "${{ matrix.python-version }}" | |
| - name: Test | |
| run: python -m pytest -q | |
| - name: Test installed CLI end to end | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| test_bin="$RUNNER_TEMP/fuckmark-bin" | |
| mkdir -p "$test_bin" | |
| cat > "$test_bin/wl-copy" <<'SH' | |
| #!/usr/bin/env sh | |
| cat > "$FUCKMARK_CLIPBOARD_CAPTURE" | |
| SH | |
| chmod +x "$test_bin/wl-copy" | |
| export PATH="$test_bin:$PATH" | |
| expected_long="$(printf 'I do not agree and I cannot stay.\n' | python -c "from fuckmark.cycle8.letter_mix import apply_letter_alternating_mix; import sys; sys.stdout.write(apply_letter_alternating_mix(sys.stdin.read()))")" | |
| expected_short="$(printf 'I do not agree.\n' | python -c "from fuckmark.cycle8.letter_mix import apply_letter_alternating_mix; import sys; sys.stdout.write(apply_letter_alternating_mix(sys.stdin.read()))")" | |
| for command in FuckMark Fuckmark fuckmark; do | |
| command -v "$command" | |
| capture="$RUNNER_TEMP/${command}.clipboard" | |
| export FUCKMARK_CLIPBOARD_CAPTURE="$capture" | |
| output="$(printf 'I do not agree and I cannot stay.\n' | "$command" --stdin --copy)" | |
| printf '%s\n' "$output" | |
| test "$output" = "$expected_long" | |
| test "$(cat "$capture")" = "$expected_long" | |
| done | |
| test "$(printf 'I do not agree.\n' | FuckMark)" = "$expected_short" | |
| test "$(printf 'I do not agree.\n' | FuckMark --stdin --visible)" = "I do not agree." | |
| expected_arg="$(python -c "from fuckmark.cycle8.letter_mix import apply_letter_alternating_mix; import sys; sys.stdout.write(apply_letter_alternating_mix('I do not agree.'))")" | |
| test "$(FuckMark 'I do not agree.')" = "$expected_arg" | |
| FuckMark --help >/dev/null | |
| python - <<'PY' | |
| from io import StringIO | |
| from fuckmark.cli import main | |
| from fuckmark.cycle8.letter_mix import apply_letter_alternating_mix | |
| class Tty(StringIO): | |
| def isatty(self): | |
| return True | |
| copied = [] | |
| out = StringIO() | |
| err = StringIO() | |
| src = Tty("I do not agree.\n\nSecond paragraph.\n:done\n") | |
| assert main(src, out, copied.append, error_stream=err) == 0 | |
| expected = apply_letter_alternating_mix("I do not agree.\n\nSecond paragraph.") | |
| assert copied == [expected], copied | |
| assert out.getvalue() == "" | |
| ui = err.getvalue() | |
| assert "Processing..." in ui | |
| assert "Copied to clipboard" in ui | |
| assert expected not in ui | |
| print("interactive e2e ok") | |
| PY | |
| cli-io: | |
| name: CLI I/O / ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Set up Python | |
| uses: actions/setup-python@v7 | |
| with: | |
| python-version: "3.12" | |
| cache: pip | |
| - name: Install | |
| run: python -m pip install --upgrade pip && python -m pip install -e ".[dev]" | |
| - name: Real file stdin and stdout I/O | |
| run: python -m pytest -q tests/test_cli.py tests/test_cli_io_contract.py tests/test_letter_mix_machine_text.py | |
| calibration-readiness: | |
| name: Frozen calibration readiness | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Set up Python | |
| uses: actions/setup-python@v7 | |
| with: | |
| python-version: "3.12" | |
| cache: pip | |
| - name: Install | |
| run: python -m pip install -e ".[dev]" | |
| - name: Materialize frozen CAL-SELECT and CAL-AUDIT candidate-pool plans | |
| run: >- | |
| python -m fuckmark.mid_dev_calibration_readiness | |
| --readiness-json calibration-readiness/mid-dev-calibration-readiness.json | |
| --select-plan-json calibration-readiness/mid-dev-cal-select-plan.json | |
| --audit-plan-json calibration-readiness/mid-dev-cal-audit-plan.json | |
| - name: Enforce frozen v2 candidate-pool dimensions and independence | |
| run: | | |
| python - <<'PY' | |
| import json | |
| readiness = json.load(open('calibration-readiness/mid-dev-calibration-readiness.json')) | |
| assert readiness['algorithm_version'] == 'mid-dev-calibration-readiness-v2' | |
| assert readiness['negatives_per_target'] == 20000 | |
| assert readiness['shard_size'] == 500 | |
| assert readiness['select_plan']['role'] == 'CAL-SELECT' | |
| assert readiness['audit_plan']['role'] == 'CAL-AUDIT' | |
| assert len(readiness['select_plan']['shards']) == 80 | |
| assert len(readiness['audit_plan']['shards']) == 80 | |
| assert len(readiness['select_plan']['prompt_ids']) == 40000 | |
| assert len(readiness['audit_plan']['prompt_ids']) == 40000 | |
| assert readiness['select_plan_hash'] != readiness['audit_plan_hash'] | |
| assert readiness['role_independence_hash'] | |
| print('readiness_hash=' + readiness['readiness_hash']) | |
| print('select_plan_hash=' + readiness['select_plan_hash']) | |
| print('audit_plan_hash=' + readiness['audit_plan_hash']) | |
| print('role_independence_hash=' + readiness['role_independence_hash']) | |
| print('candidate_count_per_role=40000') | |
| print('shards_per_role=80') | |
| PY | |
| - name: Seal readiness artifact hashes | |
| run: sha256sum calibration-readiness/*.json | sort > calibration-readiness/SHA256SUMS.txt | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: middev-calibration-readiness | |
| path: calibration-readiness/ | |
| if-no-files-found: error | |
| wasm-scan: | |
| name: WASM hidden-scan | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-unknown-unknown | |
| - name: Set up Python | |
| uses: actions/setup-python@v7 | |
| with: | |
| python-version: "3.12" | |
| cache: pip | |
| - name: Set up Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| - name: Test crate and build wasm32 | |
| run: | | |
| cargo test --manifest-path crates/fuckmark-scan/Cargo.toml | |
| cargo build --release --target wasm32-unknown-unknown --manifest-path crates/fuckmark-scan/Cargo.toml | |
| test -f crates/fuckmark-scan/target/wasm32-unknown-unknown/release/fuckmark_scan.wasm | |
| - name: Build host library and language bindings | |
| run: | | |
| ./crates/fuckmark-scan/build-native.sh | |
| python -m pip install --upgrade pip | |
| python -m pip install -e ".[dev]" | |
| python -m pytest -q tests/test_language_bindings.py tests/test_scan_wasm.py | |