From 82569246edd3123288efb10771b5819f8d3f4697 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 1 Dec 2026 19:42:36 +0000 Subject: [PATCH] =?UTF-8?q?Follow=20up=20overfull=203.3.0:=20interop=20?= =?UTF-8?q?=C2=A76,=20review-records=20rule,=20release-file=20contract?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - docs/interop.md §6: overfull's O1 and O2 are fixed in 3.3.0, O5 added (text exactly as in the issue; nothing else in the file changes). - docs/agents.md and the agent kit: run overfull check --profile arxiv (or the venue's) before a source upload and leave out what its review-records-in-source rule reports (.proofback/, *-answered.pdf); import peer reviews with --anonymize-authors. - docs/releasing.md: proofback-node.tgz and its load()/locate() API are a contract; the publish job checks it with packaging/check-release-files.py. Closes #38 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Xj9ekYmyESdZUsW8uWkzgv --- .github/workflows/release.yml | 6 ++ CHANGELOG.md | 12 +++ docs/agents.md | 1 + docs/interop.md | 15 ++-- docs/releasing.md | 22 +++++- integrations/AGENTS.snippet.md | 5 ++ .../skills/proofback-review/SKILL.md | 6 ++ integrations/cursor/proofback.mdc | 4 + integrations/skills/proofback-review/SKILL.md | 6 ++ packaging/check-release-files.py | 75 +++++++++++++++++++ 10 files changed, 144 insertions(+), 8 deletions(-) create mode 100755 packaging/check-release-files.py diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1af7d64..a627469 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -294,6 +294,12 @@ jobs: run: python3 packaging/homebrew/generate.py "$VERSION" dist > dist/proofback.rb - name: Keep the release notes out of the upload run: mkdir -p notes && mv dist/release-notes.md notes/ + # proofback-node.tgz and its load()/locate() API are a contract with other + # projects (overfull pins the file by URL); docs/releasing.md. + - name: Check the release-file contract + env: + VERSION: ${{ needs.prepare.outputs.version }} + run: python3 packaging/check-release-files.py dist "$VERSION" - uses: softprops/action-gh-release@8a0cd651e5b2365bd640854a3fa5dfc70e4875f3 # v3.0.4 with: files: | diff --git a/CHANGELOG.md b/CHANGELOG.md index 19f87a0..9a5f04b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,18 @@ the JSON schema is versioned separately (`schema_version` in round files). ## Unreleased +### Interop with overfull + +- `docs/interop.md` §6 records that overfull 3.3.0 fixed its differences O1 and O2, + and adds O5; the file stays byte-identical in both repositories. +- The agent guide and the agent kit tell agents to run `overfull check --profile arxiv` + (or the venue's profile) before a source upload and to leave out what its + `review-records-in-source` rule reports, such as `.proofback/` and `*-answered.pdf`; + and to import peer reviews with `--anonymize-authors`. +- Release files: `proofback-node.tgz` and its `load()` and `locate()` API are now a + documented contract (overfull pins the file by URL), and the release workflow checks + them before publishing (`packaging/check-release-files.py`). + ## 0.3.0 (2026-12-01) ### Breaking changes diff --git a/docs/agents.md b/docs/agents.md index 5f1017f..315c7ac 100644 --- a/docs/agents.md +++ b/docs/agents.md @@ -82,6 +82,7 @@ The handoffs: | New references | Add each with `overfull cite`, not by hand. | | End of a round | `overfull check --json`; report each error. | | Changes PDF | `overfull diff --base ` makes it. The base is the reviewed draft: `round.source.commit` in `.proofback/rounds/.json`. Then `proofback letter --diff-pdf ` names it in the letter. | +| Before uploading a source package | Run `overfull check --profile arxiv` (or the venue's profile) and leave out every path its `review-records-in-source` rule reports: `.proofback/`, the `*-answered.pdf` that `proofback answer` writes, and review notes. For peer review, import with `--anonymize-authors`: without it, overfull reports `.proofback/` as an error under anonymous profiles. | `--diff-pdf` must name an existing file inside the project root; otherwise `letter` exits with code 3. Without `--diff-pdf`, in a project with `overfull.yml`, diff --git a/docs/interop.md b/docs/interop.md index 4ab6e7d..e19e178 100644 --- a/docs/interop.md +++ b/docs/interop.md @@ -143,14 +143,15 @@ Current output of each tool compared with this specification. ### overfull -Tracked in overfull's own issue; listed here so both files agree. +Tracked in overfull issue 136 (fixed in overfull 3.3.0); listed here so both files agree. -| # | Difference | Kind | -|---|---|---| -| O1 | `Problem.location` has no `column`, `end_line`, `end_column` | Additive | -| O2 | The report has no `schema_version` | Additive | -| O3 | Exit code `2` covers both usage and internal errors | Recorded; a separate internal-error code waits for the next major version | -| O4 | SARIF results have no `partialFingerprints` | Allowed by §4 (no stable id) | +| # | Difference | Kind | Resolution | +|---|---|---|---| +| O1 | `Problem.location` had no `column`, `end_line`, `end_column` | Additive | Fixed in 3.3.0: the location object has all six fields; `anonymity-link`, `figure-missing-alt` (TikZ) and PDF findings placed by proofback's locator fill the range; SARIF regions carry them | +| O2 | The report had no `schema_version` | Additive | Fixed in 3.3.0: every `--json` object starts with `tool`, `version` and `schema_version` (`1`) | +| O3 | Exit code `2` covers both usage and internal errors | Changes an exit code | Recorded; a separate internal-error code waits for v4 (overfull issue 142) | +| O4 | SARIF results have no `partialFingerprints` | Allowed by §4 (no stable id) | No change | +| O5 | `explain --list --json` prints an array, so it cannot carry the top-level fields | Allowed: §5 covers JSON objects only | No change | ## 7. Versioning diff --git a/docs/releasing.md b/docs/releasing.md index bdd9420..08d7025 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -37,7 +37,7 @@ built or published. | build | Archives for Linux, macOS and Windows (x86_64 and ARM64) with PDFium, SHA-256 files and signed build provenance. Linux links against glibc 2.17; each binary is run before upload | | vsix | VS Code extension, tested and packed as `proofback-vscode.vsix` | | node | Node package, checked against the native result and packed as `proofback-node.tgz` | -| publish | Tag `vX.Y.Z` and GitHub Release with the changelog section as notes and all of the above, plus `install.sh`, `install.ps1` and `proofback.rb` | +| publish | Checks the release-file contract (below), then tags `vX.Y.Z` and publishes the GitHub Release with the changelog section as notes and all of the above, plus `install.sh`, `install.ps1` and `proofback.rb` | | homebrew | Optional: commits `Formula/proofback.rb` to a tap repository | Everything ships through the GitHub Release; no npm or Marketplace account is used. @@ -48,6 +48,26 @@ npm install https://github.com/Amet13/proofback/releases/latest/download/proofba code --install-extension proofback-vscode.vsix # after downloading it from the release ``` +## Release files other projects depend on + +These are a contract. A release that breaks it fails before anything is published: +the publish job runs `packaging/check-release-files.py` on the files it is about to +upload. + +| File | Who depends on it | Contract | +|---|---|---| +| `proofback-node.tgz` | [overfull](https://github.com/Amet13/overfull) pins `https://github.com/Amet13/proofback/releases/download/vX.Y.Z/proofback-node.tgz` as an optional dependency (overfull 3.3.0 pins `v0.3.0`) | Published with every release under exactly this name. Its Node API, `load()` and `locate(pdf, { synctex, sources, queries })` with the query and result shapes of `site/schema/locate-v1.json`, changes only with a major version. | +| `proofback-vscode.vsix` | Users, through the stable "latest" link | Published with every release under exactly this name. | + +The check fails when either file is missing, when the Node package's name or version +is wrong, when its engine files are missing, or when `lib/index.js` stops exporting +`load` and `locate` or `lib/index.d.ts` loses their declarations. Run it on a folder +of release files with: + +```bash +python3 packaging/check-release-files.py +``` + ## Optional: Homebrew tap A tap is an ordinary repository on the same GitHub account, so no new account is diff --git a/integrations/AGENTS.snippet.md b/integrations/AGENTS.snippet.md index d05449e..d92d2e8 100644 --- a/integrations/AGENTS.snippet.md +++ b/integrations/AGENTS.snippet.md @@ -16,3 +16,8 @@ in `.proofback/`. When asked to address review comments: `overfull check --json` and report each error; offer a changes PDF with `overfull diff --base `, then `proofback letter --diff-pdf `. If `overfull` is not available, skip these steps and say so once. +- Before uploading a source package (arXiv or a venue that takes sources), run + `overfull check --profile arxiv` (or the venue's profile) and leave out every path + its `review-records-in-source` rule reports, such as `.proofback/` and the + `*-answered.pdf` from `proofback answer`. For peer review, import with + `--anonymize-authors`. diff --git a/integrations/claude-code/skills/proofback-review/SKILL.md b/integrations/claude-code/skills/proofback-review/SKILL.md index 6d9b92b..248ebb3 100644 --- a/integrations/claude-code/skills/proofback-review/SKILL.md +++ b/integrations/claude-code/skills/proofback-review/SKILL.md @@ -57,6 +57,12 @@ proofback never runs it; you do, when it is installed. Check once with - **Changes PDF**: offer to make a PDF with the changes highlighted, `overfull diff --base ` (the round's `round.source.commit` is the reviewed draft), then name it in the letter: `proofback letter --diff-pdf `. +- **Before a source upload** (arXiv or a venue that takes source files): run + `overfull check --profile arxiv` (or the venue's profile) and leave out every path + that its `review-records-in-source` rule reports, such as `.proofback/` and the + `*-answered.pdf` that `proofback answer` writes. For peer review, import with + `--anonymize-authors`; otherwise overfull reports `.proofback/` as an error under + anonymous profiles. - **No overfull**: if the command is not available, skip these steps and say so to the author once. diff --git a/integrations/cursor/proofback.mdc b/integrations/cursor/proofback.mdc index f0c8c94..20000c2 100644 --- a/integrations/cursor/proofback.mdc +++ b/integrations/cursor/proofback.mdc @@ -15,3 +15,7 @@ alwaysApply: false hand; after the last item of a round run `overfull check --json` and report each error; offer `overfull diff --base ` and then `proofback letter --diff-pdf `. If it is not available, skip these steps and say so once. +- Before a source upload (arXiv or a venue that takes sources), run `overfull check + --profile arxiv` (or the venue's profile) and leave out every path its + `review-records-in-source` rule reports, such as `.proofback/` and `*-answered.pdf`; + for peer review, import with `--anonymize-authors`. diff --git a/integrations/skills/proofback-review/SKILL.md b/integrations/skills/proofback-review/SKILL.md index 6d9b92b..248ebb3 100644 --- a/integrations/skills/proofback-review/SKILL.md +++ b/integrations/skills/proofback-review/SKILL.md @@ -57,6 +57,12 @@ proofback never runs it; you do, when it is installed. Check once with - **Changes PDF**: offer to make a PDF with the changes highlighted, `overfull diff --base ` (the round's `round.source.commit` is the reviewed draft), then name it in the letter: `proofback letter --diff-pdf `. +- **Before a source upload** (arXiv or a venue that takes source files): run + `overfull check --profile arxiv` (or the venue's profile) and leave out every path + that its `review-records-in-source` rule reports, such as `.proofback/` and the + `*-answered.pdf` that `proofback answer` writes. For peer review, import with + `--anonymize-authors`; otherwise overfull reports `.proofback/` as an error under + anonymous profiles. - **No overfull**: if the command is not available, skip these steps and say so to the author once. diff --git a/packaging/check-release-files.py b/packaging/check-release-files.py new file mode 100755 index 0000000..ae07d8c --- /dev/null +++ b/packaging/check-release-files.py @@ -0,0 +1,75 @@ +#!/usr/bin/env python3 +"""Check the release files that other projects depend on, before they are published. + +Usage: check-release-files.py + +The contract (docs/releasing.md): +- `proofback-node.tgz` is published with every release. overfull pins it by URL + (`releases/download/vX.Y.Z/proofback-node.tgz`) and calls `load()` and `locate()`. +- That Node API (`load()`, `locate(pdf, { synctex, sources, queries })` with the + locate-v1 shapes) changes only with a major version. +- `proofback-vscode.vsix` is published with every release (stable "latest" link). +""" +import json +import sys +import tarfile +from pathlib import Path + +ENGINE = ("package/engine/proofback_wasm.js", "package/engine/proofback_wasm_bg.wasm") + + +def check_node(path: Path, version: str) -> list[str]: + errors = [] + try: + with tarfile.open(path, "r:gz") as tar: + names = set(tar.getnames()) + + def text(name: str) -> str: + member = tar.extractfile(name) + return member.read().decode("utf-8") if member else "" + + pkg = json.loads(text("package/package.json")) if "package/package.json" in names else {} + if pkg.get("name") != "proofback": + errors.append(f"{path.name}: package name is {pkg.get('name')!r}, not 'proofback'") + if pkg.get("version") != version: + errors.append(f"{path.name}: package version is {pkg.get('version')!r}, not {version!r}") + for need in ("package/lib/index.js", "package/lib/index.d.ts", *ENGINE): + if need not in names: + errors.append(f"{path.name}: missing {need}") + if "package/lib/index.js" in names: + js = text("package/lib/index.js") + exports = js[js.rfind("module.exports"):] + for fn in ("load", "locate"): + if fn not in exports.split("{", 1)[-1].split("}", 1)[0].replace(" ", "").split(","): + errors.append(f"{path.name}: lib/index.js does not export {fn}()") + if "package/lib/index.d.ts" in names: + dts = text("package/lib/index.d.ts") + for decl in ("export function load(", "export function locate(", "interface LocateQuery", "interface LocateResult"): + if decl not in dts: + errors.append(f"{path.name}: lib/index.d.ts has no `{decl}`") + except (OSError, tarfile.TarError, json.JSONDecodeError) as e: + errors.append(f"{path.name}: not a readable package ({e})") + return errors + + +def main() -> int: + if len(sys.argv) != 3: + print(__doc__.strip().splitlines()[2], file=sys.stderr) + return 2 + folder, version = Path(sys.argv[1]), sys.argv[2].lstrip("v") + errors = [] + for required in ("proofback-node.tgz", "proofback-vscode.vsix"): + if not (folder / required).is_file(): + errors.append(f"missing release file {required} (a contract, see docs/releasing.md)") + if (folder / "proofback-node.tgz").is_file(): + errors += check_node(folder / "proofback-node.tgz", version) + for e in errors: + print(f"::error::{e}") + if errors: + return 1 + print(f"release files for {version}: proofback-node.tgz and proofback-vscode.vsix present; Node API has load() and locate()") + return 0 + + +if __name__ == "__main__": + sys.exit(main())