Skip to content

Correct the diff header, and stop warning on every run - #14

Merged
n1ckyb merged 2 commits into
release/v0.0.2-rcfrom
fix/cli-header-and-stderr
Aug 9, 2026
Merged

Correct the diff header, and stop warning on every run#14
n1ckyb merged 2 commits into
release/v0.0.2-rcfrom
fix/cli-header-and-stderr

Conversation

@n1ckyb

@n1ckyb n1ckyb commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Fixes #12 and #13. Both produced a correct diff and still made the tool look broken, which is why no diff test caught either.

The header said a file was compared with itself

| Old       b.py         |   <-- was the NEW filename
| New       b.py         |
| Scope     working tree |   <-- no working tree involved

Source.get_content() returns one filename because that is what language detection needs, and for a git diff one name genuinely covers both sides — same path, two revisions. FileSource is the exception: it knew both names and threw one away. It now surfaces them through a new display_names() hook that defaults to None ("one name applies to both"), so no other source changes behaviour.

Scope was a renderer default printed for file, string and patch diffs alike. It now appears only when a staging status is actually known — which is the commit path, where it means something.

Every run wrote a warning to stderr

Naming INTENTUMDIFF_ALLOW_VULNERABLE_WASMTIME, beside correct results. Nothing was actionable: first-party plugins ship inside the wheel and third-party ones stay blocked either way. Now debug.

The deliberate-override warning stays a warning — disabling a safety check is worth saying — but fires once per process rather than once per plugin load. There are 78 plugins.

Verified

| Old       a.py   |
| New       b.py   |
| Language  python |
| Changes   1      |

stderr: empty. Five new tests, all passing, including one asserting a successful diff logs nothing at warning or above — the assertion that would have caught 0.0.1's 69 error lines.

🤖 Generated with Claude Code

Two defects that each produced a CORRECT diff and still made the tool look
broken. Neither could fail a diff test, so neither was caught.

1. 'intentumdiff file a.py b.py' labelled both sides 'b.py', so the header
   said a file had been compared with itself — directly above the right
   answer. Source.get_content returns one filename because that is what
   language detection needs, and for a git diff one name genuinely covers
   both sides. FileSource is the exception and knew both names all along, so
   it now surfaces them via display_names().

2. Every run wrote an OSV advisory warning to stderr naming an
   'allow vulnerable' override. Nothing was actionable: first-party plugins
   ship inside the wheel and third-party ones stay blocked either way. It is
   now debug. The deliberate-override warning stays a warning, since
   disabling a safety check is worth saying, but fires once per process
   rather than once per plugin — there are 78 plugins.

Also drops 'Scope: working tree' from diffs where no working tree exists; it
was a renderer default printed for file, string and patch diffs alike, and is
now shown only when a staging status is actually known.

Fixes #12
Fixes #13

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

n1ckyb added a commit that referenced this pull request Aug 9, 2026
* fix: land the verified 0.0.1 fixes in the repo that publishes the wheel

This repo publishes intentumdiff-python to PyPI, and it did not have the fixes
for the defects that got 0.0.1 pulled. They were stranded in PR #15 (now
conflicting) and #14. Two were missing outright:

- src/intentumdiff/__main__.py — `python -m intentumdiff` failed in 0.0.1
  because this file did not exist. It still did not exist here.
- scripts/smoke_published_wheel.py — the release gate itself: installs the
  artefact into a clean venv and checks install, import, console script,
  `python -m`, a real diff, clean stderr, and that every URL resolves.

The engine fixes, all verified against a green build in the experiments repo:

- rust_core.py: canonicalise the distribution-qualified parser plugin id. The
  wheel publishes as intentumdiff-python while the import package is
  intentumdiff, so the certified parser arrived as
  'intentumdiff-python:python:python' and failed an allowlist that only knew
  'intentumdiff:python:python'. The certified batch path declined with
  "unsupported parser plugin" and fell through to routed finalize — Rust to
  Rust, so no gate fired and nothing looked wrong, while the certification and
  the facts only that path derives were silently absent.
- registry.py: trust the package's own distribution name. THE 0.0.1 defect.
- loader.py: the OSV advisory notice is debug, not warning. It fired on every
  ordinary run and put alarming text on stderr beside correct results.
- _shared.py: `file a.py b.py` labelled both sides with the NEW filename, and
  claimed a "working tree" scope for diffs with no working tree.
- sources/: a source that compares two differently named files now says so;
  get_content returns one filename because that is what language detection
  needs, and both sides inherited it.
- core/models.py: facts_trace, populated only under INTENTUMDIFF_TRACE_FACTS.
- live_server.py: the perceptual asset_diff op.
- differ.py: display names applied at the boundary that knows both.

Verified before syncing: Rust 266 passed, extension 260 passed, Python suite
running. The experiments repo has no CI (Actions disabled on billing), so this
repo's own CI is the gate — which is the point of syncing here.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix(build): resolve the core from the RC, not main

CORE_REF was "main". But main only moves when a release is cut, so a consumer
pinned to it cannot verify against an unreleased engine change — which is
exactly what a release candidate exists to allow.

That gap is not theoretical. The provenance tests in this PR assert facts_trace,
added to the engine, and failed in CI while passing locally: CI was building an
engine that predated the feature under test. The tests were right; the pin was
wrong.

Now follows release/v0.0.2-rc, and reads INTENTUMDIFF_CORE_REF so a one-off
build can point elsewhere without editing the file.

Tracking a branch does make the build unreproducible, so this becomes a TAG the
moment intentumdiff-core cuts one. The comment says so where the next person
will read it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* release: 0.0.2b1

PEP 440 spells the prerelease 0.0.2b1 — no hyphen, no dot — where Cargo and
npm use 0.0.2-beta.1. Same release, three spellings, and the publish workflow
asserts the tag matches this string exactly.

Beta because 0.0.1 was published without anyone installing the artefact and
using it. A version without a beta marker is a claim of stability, and that
claim follows use rather than preceding it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* test: derive the version instead of hardcoding it

Three tests asserted the literal "0.0.1", so bumping to 0.0.2b1 failed them —
for a reason that has nothing to do with what any of them checks. Two assert
CLI BRANDING and one asserts IMPORT PURITY; none is about which version is
current.

A hardcoded version in a test is the same defect the release skill names for
workflows: "derive the expected version, never a literal. A hardcoded version
goes stale silently and fails at the very end of a release, blaming the
artefact when the gate was wrong."

They now read __version__. Importing it into the purity test is safe: that
test's subject is a subprocess, so the parent's imports are not what it
measures.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: n1ckyb <nicknuxton@icloud.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
@n1ckyb
n1ckyb merged commit 760510d into release/v0.0.2-rc Aug 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant