Repository navigation
Prevent target Git execution and harden provenance/report contracts - #61
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 17 minutes. View limit details
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. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
|
Add Carrot credits or activate Agent usage billing to use Autofix |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3946e40f11
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| pub fn validate_reader(reader: impl std::io::Read) -> Result<String> { | ||
| validate_value(serde_json::from_reader(reader)?) |
There was a problem hiding this comment.
Reconcile the evidence contract with unbounded report input
The public contract in docs/EVIDENCE-CONTRACT.adoc still states that report JSON is capped at 16 MiB, but this reader now accepts arbitrarily large input and materializes it in memory. Consumers relying on that documented resource bound may process unexpectedly large reports without external limits; update the authoritative contract alongside this behavior change or retain an explicit ceiling.
Useful? React with 👍 / 👎.
| # Exercise the production build script in a minimal isolated Cargo repository. | ||
| set -euo pipefail |
There was a problem hiding this comment.
Wire the provenance regression test into CI
This standalone shell test is not discovered by cargo test, and the checked .github/workflows/rust-ci.yml, Justfile, and repository-wide references do not invoke it; CI currently runs only the Rust tests and tests/e2e.sh. Consequently, the new build-provenance behavior can regress while every configured project check remains green, so add this script to the CI/check entry point.
Useful? React with 👍 / 👎.
| println!("cargo:rerun-if-changed=../../.git/HEAD"); | ||
| println!("cargo:rerun-if-changed=../../.git/refs/heads"); | ||
| // Ask Git for metadata paths: .git may be a worktree pointer file. | ||
| for name in ["HEAD", "refs/heads", "index", "packed-refs"] { |
There was a problem hiding this comment.
Avoid watching absent Git metadata files
In repositories where .git/packed-refs does not exist, such as an ordinary freshly initialized repository with only loose refs, git rev-parse --git-path packed-refs still succeeds and this emits a dependency on the missing file. Cargo then reports that dependency as stale on every invocation and reruns the build script, recompiling pons-core and its dependents even when nothing changed. Emit the directive only when the resolved metadata path exists, or watch an existing containing path instead.
Useful? React with 👍 / 👎.
| .env("GIT_CONFIG_NOSYSTEM", "1") | ||
| .env( | ||
| "GIT_CONFIG_GLOBAL", | ||
| if cfg!(windows) { "NUL" } else { "/dev/null" }, |
There was a problem hiding this comment.
Preserve trusted safe-directory handling for provenance
When Pons runs under a different UID from the target checkout—a common container or mounted-workspace setup—Git permits the repository only through safe.directory in protected global or system configuration. Nulling both configuration scopes discards that operator-approved exception, so rev-parse fails and the report silently emits target.commit = null even though the same command previously succeeded. Keep the target configuration isolated while explicitly marking the scanned directory safe for this read-only command.
Useful? React with 👍 / 👎.
…am prompts * `docs/CI-CD.adoc` — the contract this repository's CI holds itself to: what runs, what is required, what each gate may assume, and the failure modes this repository actually suffered. The invisible ones are the point: a workflow that calls a reusable under an owner the Actions allowlist does not admit dies at startup with no job and no check run, and `gh pr checks` shows nothing, because a rejected run produces no check run. * `docs/PR57-RECONCILIATION.adoc` — the final disposition. PR #57 branched before #58, #61 and #63 and was never rebased, so merging it forward as a branch would DELETE main's reconciled work, not merely conflict with it. The reconciliation above stands, and the reasons are now sharper: PR #57's generic `empty-php-function` rule is not a merge conflict but a CONTRADICTION of #63's contract, because main's `php-empty-security-function` negative corpus asserts that an empty non-security function produces no finding and PR #57's rule fires on it. The narrower rule that would be correct — empty ANONYMOUS callables, which PR #57's callback fixture covers and no existing rule does — is specified, and needs a compiler in hand. The six SonarCloud diagnostics that remain on main's fixtures are handled by the fixture-aware gate added in the previous commit, and the rule keys come from the analyser's source rather than from memory. * `docs/handoffs/upstream-prompts.adoc` — seven ready-to-paste prompts for the repositories that have to change for this work to be complete. The first is the merge blocker this repository could not fix alone: the estate's canonical Actions allowlist admits `hyperpolymath/*` and does not list `metadatastician/*`, so a caller that spells the transferred owner is refused at startup and the required context is never emitted. The others are the KYAML step-6 precondition, the canonical-bytes contract for reports that cross a trust boundary, the squabbler's consumer-side permission story, the `proven-bench` document contract for non-Idris harnesses, the panic-attack interop for a Rust producer, and the vocabulary for "structurally valid but not conformant" in DEED/K9. * `docs/handoffs/format-toolchain/05-pons-asinorum.md` — the standing prompt for this repository, with a status update: what is done, what is deliberately not done, and why. The library-level ijson-jcs adoption is explicitly still open, because it needs `Cargo.lock` regenerated against a git dependency. * `CHANGELOG.adoc` — the user-visible half of all of the above. Co-authored-by: arena-agent <[email protected]>



A target repository's local Git configuration could make
git statusexecute a filesystem monitor while Pons collected provenance. Pons now reads only the commit identity, with configuration isolation, and leaves whole-targetdirtyas unknown. Per-file digests continue to identify analysed bytes. No target status/diff operation is used, avoiding both monitors and clean-filter execution.Also addresses three post-merge review findings from #58:
validate-reportreads buffered JSON without an arbitrary 16 MiB input ceiling. Schema/semantic checks still materialise the value; external process resource limits remain necessary for hostile reports.strict_transitions=trueis rejected under protocol schema 0.1.0 and requires 0.2.0.Validation:
This is a narrowly scoped follow-up to merged #58. Historical eleven-target scan evidence remains tied to its measured source commits; no new application-rule results or performance claims are inferred from these checks. The five format/toolchain prompts remain in
docs/handoffs/format-toolchain/.Verified checkpoint
3946e40f112dfdd42736e2683195be22b9858997has exact tested tree3158e9ad401ff47ab27ad962d3ed06e9b7273d1b; original commits are retained atcodex/pons-provenance-unsigned-backup. Checkpoint PR #60 targeted a non-main branch. Main branch protection is unchanged.