Skip to content

fix(evidence): derive reader path candidates by component, as the writer does - #74

Merged
hyperpolymath merged 2 commits into
mainfrom
marina/optimistic-cray-js64k7
Nov 10, 2026
Merged

hyperpolymath merged 2 commits into
mainfrom
marina/optimistic-cray-js64k7

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

This change closes the open Codex finding on #73 (discussion_r4503157325). It contributes to hyperpolymath/echo-types#362. It does not close that issue.

Defect

The writer keys a file with Path::strip_prefix, which compares components. The reader removed a literal string prefix. For root repo and file repo/./a.php, the writer keyed a.php and the reader derived ./a.php.

Reproduced at 612145d805c6ec519d60fc65e406e9c091462848 on x86_64 Linux with rustc 1.97.1 (8bab26f4f, the rust-toolchain.toml pin):

  • Engine::scan_files wrote record path sample.php for the file <root>/./sample.php. pons validate-report rejected that report: semantic fingerprint mismatch as 0.5.0, and record/finding mismatch as its frozen 0.4.0 projection.
  • The same disagreement occurred for repo/./sub/a.php, repo//a.php, repo/a.php/., the root spelling repo/., the absolute form /tmp/repo/./a.php, and one file named twice (file repo/./a.php, root repo/a.php).
  • Not affected: the root spelling repo//, ./a.php below ., and spelling after the first kept component (repo/sub/./a.php is sub/./a.php on both sides).
  • The Windows spelling repo\.\a.php does not reproduce on a POSIX writer. The Windows reading in the reader had the defect. A Windows writer was not run locally.

Change

path_for_style in crates/pons-core/src/evidence.rs now compares components for each reading: the root, then every name. Empty components and every . except a leading one are dropped. .. is kept. The result is the spelling of the producer from the next component to the end of the last one, as Components::as_path returns it.

Not changed: relative_path, corroborate::semantic_fingerprint, report/validate.rs (the rule that requires one reading for the record path and the fingerprint), and both schemas. Current and frozen keys are therefore unchanged. The lexical ./a.php is not an additional candidate.

Controls

  • component_equivalent_spellings_have_the_writer_key: exact POSIX and Windows readings for each case. The native writer is compared with the reading of the host that runs the test.
  • the_host_reading_is_the_native_writer_on_every_short_path: the native writer against the host reading for every path of up to 6 characters over a name, . and the host separators, against every root of up to 4 characters. This is 132,253 pairs on Linux. The Windows job runs the same comparison with both separators.
  • a_component_equivalent_file_spelling_validates_with_the_writer_key (CLI contract): the scan_files report of this build goes through pons validate-report as 0.5.0 and as 0.4.0, with its absolute root and with the relative label repo in both separator styles. The test rejects ./sample.php as a record path, as a fingerprint input, as both together, and in a frozen report.
  • The existing controls stay green, which include ambiguous_legacy_paths_require_one_consistent_record_and_fingerprint, a_forged_corroboration_key_is_rejected and a_relative_windows_report_validates_on_every_reader_host.

Local validation (x86_64 Linux, rustc 1.97.1)

Command Result
cargo fmt --check pass
RUSTFLAGS="-D warnings" cargo clippy --workspace --all-targets -- -D warnings pass
cargo test --workspace --no-fail-fast as root 266 passed, 3 failed
The same command at 612145d as root 263 passed, 3 failed
pons-core unit binary as uid 1000 146 passed, 0 failed
cargo build --release then bash tests/e2e.sh 46 passed, 0 failed, 0 skipped
PONS_BIN=target/release/pons bash tests/doc_drift.sh pass

The 3 failures are the POSIX permission fixtures. They refuse to run as root (fixture is readable despite mode 000 — running as root?). They are not related to this change.

Three deliberate reader mutations (keep interior ., drop the parent rule, keep trailing components) each failed both new unit tests. The mutations are not committed.

Echo rescan with the release build of 428e81b (clean) at echo-types b6c8b97b40c1cf6489f0c93d2dd6183c30e4d0e4:

  • pons scan docs/echo-types/prototypes/warrant_debugger_prototype.jsx --no-speculative --fail-on error --fail-on-skips --require-language javascript --format json: 1 file analysed, 0 findings, 0 skips, complete-within-policy, exit 0.
  • pons scan . --no-speculative --fail-on error --format json: 3 files analysed, 8 heuristic warnings, 23 explicit skips, partial, exit 0.
  • Both reports pass pons validate-report.

Limits

  • No Windows host ran these tests locally. The hosted Linux and Windows checks on this pull request are the evidence for that platform.
  • Drive, UNC and verbatim prefixes remain ordinary names in the reader, as at 612145d. A drive-letter case difference, a bare C: root and . below a \\?\ root are not modelled, and no test here covers them.
  • Creusot with Pearlite contracts and Verus remain OPEN, not run. The tests, including the exhaustive comparison, are tests and not proofs.
  • This pull request has no reviewer approval. An automated review is not an independent human approval.

Generated by Claude Code

…ter does

The writer keys a file with `Path::strip_prefix`, which compares
components. The reader removed a literal string prefix. For root `repo`
and file `repo/./a.php` the writer keyed `a.php` and the reader derived
`./a.php`, so `validate-report` rejected a report this build had written:
`semantic fingerprint mismatch` as 0.5.0 and `record/finding mismatch` as
its frozen 0.4.0 projection. Repeated separators, a trailing `.`, the
root spelling `repo/.` and a file named twice had the same defect.

`path_for_style` now compares components for each reading (the root,
then every name; empty components and every `.` except a leading one are
dropped; `..` is kept) and returns the producer's spelling from the next
component to the end of the last one. `relative_path`, the semantic
fingerprint, the single-reading rule in the validator and both schemas
are unchanged, so current and frozen keys are unchanged. The lexical
`./a.php` is not an extra candidate.

Controls: exact POSIX and Windows readings for each case, compared with
the native writer on the host that runs them; an exhaustive comparison
of the native writer with the host reading over every short path
(132,253 pairs on Linux); and a contract test that drives this build's
own `scan_files` report through `pons validate-report` as 0.5.0 and
0.4.0, with relative `repo` labels in both separator styles, and rejects
the lexical key as record path, fingerprint input, both, and in a frozen
report.

Validation on x86_64 Linux, rustc 1.97.1: fmt and all-target Clippy with
warnings denied passed. As root, 266 tests passed and the three POSIX
permission fixtures failed, as they do at 612145d (263 passed, 3
failed); the pons-core unit binary as uid 1000 passed 146 of 146.
tests/e2e.sh passed 46 of 46 on the release build. No Windows host ran
these tests locally; hosted Linux and Windows checks must complete on
the pull request. Drive, UNC and verbatim prefixes remain ordinary names
in the reader. Creusot/Pearlite and Verus remain OPEN/not run.

Addresses the open review finding on #73 and contributes to
hyperpolymath/echo-types#362.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0136P7ZmAsYpFA9gxfQLF3F6
Signed-off-by: Claude <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0136P7ZmAsYpFA9gxfQLF3F6
Signed-off-by: Claude <noreply@anthropic.com>
@hyperpolymath
hyperpolymath marked this pull request as ready for review November 10, 2026 14:40
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-10T14:40:36.810745Z
We couldn’t complete this review. Comment @codex review to try again.
59f3464 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@hyperpolymath
hyperpolymath enabled auto-merge (squash) November 10, 2026 14:40
@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.

@sonarqubecloud

Copy link
Copy Markdown

@hyperpolymath
hyperpolymath merged commit d4adad0 into main Nov 10, 2026
14 checks passed
@hyperpolymath
hyperpolymath deleted the marina/optimistic-cray-js64k7 branch November 10, 2026 14:41
hyperpolymath added a commit to hyperpolymath/echo-types that referenced this pull request Nov 10, 2026
This change records the evidence that was read on 10 November 2026 for
#362. It is documentation only. No Agda source changes and no proof
claim changes. It does not close #362.

## What changes

- New file `docs/audit/2026-11-10-scanner-follow-up-update.adoc`. It is
a dated update to the 7 November receipt. It names each earlier
statement that it supersedes.
- `docs/audit/2026-11-07-scanner-follow-up.adoc`: one section is added
at the end with a link to the update. The 145 earlier lines are
unchanged.
- `docs/AUDIT.adoc`: index entries for the 7 November receipt and for
the update.

## What the update records

| Item | Result |
|---|---|
| PANIC attribution | Pull requests 268 to 271 are attributed one by
one, from a fresh clone. `f2a6a70` is on `main`. |
| PONS 73 | Merged as `612145d` with the tested tree `28d2068a`. This
supersedes "must complete its final review and merge". |
| Path defect | Reproduced at `612145d`. Repaired on `main` by
hyperpolymath/pons-asinorum#74, merged as `d4adad0`. Hosted Linux and
Windows jobs passed on the pull-request head and on `main`. |
| Review threads | One disposition for each of the 9 threads on PONS 72
and 73. One thread on 73 is still marked unresolved; I did not change
it. |
| CodeQL | Run 42400643452, attempt 2, read back as success. The
deletion of the obsolete category stays owner-reported. This supersedes
"approval is pending". |
| Echo rescan | With PONS `d4adad0`: the JSX file gives 0 findings and 0
skips. The whole input gives 3 files, 8 heuristic warnings and 23 skips,
`partial`. |

## States that stay open or not verified

- No review of pons-asinorum 74 was obtained. The CodeRabbit check reads
cancelled because the pull request closed. Codex reported its usage
limit.
- The CodeRabbit review of the original audit (360) is not obtained.
- Two PONS workflows (`main-estate-audit.yml`, `creusot-gate.yml`) ended
with no jobs on PONS `main`. They call the suite by its former name
`hyperpolymath/cicd-suite`. A run with no jobs is not a pass. See
hyperpolymath/proven-cicd-and-workflows#68.
- Code-scanning analyses and alerts, the app installation inventory and
the `panic-attack` pull-request records were not accessible to this
session.
- Agda is outside PONS coverage. SMTP is dormant. Creusot with Pearlite
contracts and Verus are OPEN, not run. No independent human approval is
claimed.

## Verification

- `sh scripts/verify.sh` exited 0 with the pinned Agda 2.7.0.1
(`scripts/setup-agda.sh`): the 4 static guards passed and 27 of 27 proof
checks passed. This run was on the documentation change before its last
wording edits. The proof sources are identical.
- The 4 static guards were run again on the final tree and passed:
`scripts/kernel-guard.sh`, `tools/check-guardrails.sh proofs/agda`,
`scripts/check-experimental-aggregate.sh`,
`scripts/check-agda-invocations.sh`.

Refs #362

---
_Generated by [Claude
Code](https://claude.ai/code/session_0136P7ZmAsYpFA9gxfQLF3F6)_

---------

Signed-off-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
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.

3 participants