Skip to content

test(layout): verify offline inspection and compatibility regressions - #226

Merged
toddysm merged 18 commits into
mainfrom
feature/oci-layout-tree/regression-0bb156e8
Nov 26, 2026
Merged

toddysm merged 18 commits into
mainfrom
feature/oci-layout-tree/regression-0bb156e8

Conversation

@toddysm

@toddysm toddysm commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

Scope

Closes #216. Related tracking issue: #130 remains in progress; final documentation #217 and the separate 0.3 removal #209 are not included.

Prerequisites #215 and #208 merged through #224 and #225. Implements the approved section-10 fixture/measurement protocol without inventing numerical release thresholds.

  • Deterministic stored fixture family: simple, nested/multi-root, subject-linked, shared, mixed/unknown, incomplete and pinned BusyBox metadata.
  • Seven real public BusyBox metadata documents retained with exact digest verification. Local payload stand-ins are two bytes; only dependent sizes change. No downloaded image layers are committed or needed.
  • 72 integrated cases (71 on Mac plus one Linux-only RSS case) verify selected SDK/CLI bytes, exact statistics, provenance, limits, diagnostics/streams, safe ASCII/JSON, immutable stored bytes/modes/identities/timestamps, forbidden IO/effects and legacy compatibility. Negative cases cover cached Python 3.10 pathlib, credential bindings, inherited RSS, native/positional/vectored reads, extra descriptor wrappers, constructor reads, worker failure retention, full-path stat/lstat cache checks, complete fingerprint coverage and early threshold rejection.
  • Fresh-process all-four-view resource harness checks exact 1,024-wide/100-by-64-reuse counts and per-address IO, recording one warm-up and five samples per view, median/maximum elapsed and peak RSS bytes.
  • Linux/Python 3.12 CI enforces owner-approved resource limits and retains evidence even on failure; minimum Click and Windows rejection selectors include the new suite. macOS measurements/validation are local. Existing hosted platform jobs remain unchanged.
  • Related library/developer reference documents fixture limitations and reproducible baseline/approved-threshold reruns.

Validation

  • Current head 687ec17f270613a4a0131d5ab29347d0aaf073ba, local Mac/Python 3.12.4: 71 integrated cases pass, one Linux-only RSS case skipped. Every numeric cap unchanged. Historical broader regressions are not claimed as a current-head rerun.
  • Scoped Ruff lint/format, mypy, Bandit, actionlint/yamllint, fixture JSON and whitespace checks passed. mypy skips untyped external JSON Schema imports; Bandit skips normal test assertions and reviewed non-shell local subprocess calls.
  • Source contracts: every new module/type/callable/helper documented and placement checked; behavior reviewed against signatures and tests. No production SDK/CLI behavior or dependencies changed.
  • Isolated development dependencies satisfy declared constraints after restoring packages via pip. Newer Click emits existing deprecation warnings; these are not test failures.
  • Local self-review of the current fix has no unresolved findings. Both Copilot guard findings were fixed with negative tests and separately replied with the pushed SHA before resolution.
  • Current-head hosted Tests pass all active jobs; Python 3.12 full suite: 5,289 passed, five skipped. CodeQL passed. Actual exact-head Copilot review has no open code issues; its final-resource-evidence concern is satisfied by both independently verified fresh reports below. Codex quota exhausted, no Codex approval claimed.
  • Three human findings fixed in signed a9ef528330e5e1c9630ef6f93ecd90cbc403835c, each replied before resolution: driver fingerprint, pytest/resource ordering, threshold preflight.
  • The fingerprint now includes complete driver bytes, fixture/IO builder, shared descriptor/address helper source and pinned metadata; timing/sample-count/RSS/fixture-helper changes invalidate approval. Threshold JSON, revision/platform/approval identity and all finite caps are validated before setup/workers, and the loaded limits are reused. Pytest runs first, the Linux resource gate runs with always() on 3.12, and artifact upload stays last.
  • Actual review 6081285634 identified shared fixture helpers omitted from the fingerprint. Reproduced and fixed in signed 36dd08ace44c35f45c0dc5eefe57a2a4f73578ed, with a fourth input-mutation regression and pushed-fix follow-up in the original fingerprint thread.
  • Stored-byte expectations now use independent pre-inspection fixture bytes, excluding the intentionally unvisited subject-only object. Linux peak RSS now uses post-exec VmHWM, not an inherited getrusage floor; the retained-parent-allocation regression passes in Linux CI.
  • Historical baselines/results remain in the canonical issue state/checkpoints; they are not presented as final-revision certification.
  • Evidence checked for credentials/provider tokens/private keys/authorization headers and secret-bearing URLs before persistence; no redactions needed. No configured docs build and no dependency audit claimed.

Approved resource limits and final-head evidence

The owner renewed the exact unchanged table for complete driver/builder/shared-helper/metadata fingerprint 56f6df80194c60888a9e8464b72905d786194490ff4d424d7d35848180619e66. Signed binding commit 687ec17f270613a4a0131d5ab29347d0aaf073ba is published. Both platform files match the actual approval; every numeric value is unchanged.

Fresh exact-final-head local-Mac report passes all 24 approved comparisons, with twelve five-sample cases and verified 687ec17/56f6df80/7205440161 provenance. Hosted Linux artifact 15159997089 also passes all 24 recomputed comparisons; stored checks match and integration merge f3377c26116dc281cb022681448038354ccabdfc has exactly main 7aa2f30dbb300c609c5e9f7d59cb14990e024542 and PR head 687ec17f270613a4a0131d5ab29347d0aaf073ba as parents. Both complete reports and the authentic approval match the four-source fingerprint. 48 approved comparisons pass. The preapproval baseline remains explicitly historical and unapproved when measured.

Merged normally after all exact-head/base/check/thread/review/resource gates passed as verified signed 17f82710. The merge tree exactly matches tested head 687ec17 and main contains it. #216 is closed; its eleven original obligations are reconciled through new completion evidence. No force merge, release, sibling implementation or parent close-out. Owned worktree clean, no unpublished commits; checkout/branch/claim retained.

…lines

Cover #216 with deterministic stored graphs, pinned BusyBox metadata, exact SDK/CLI and compatibility assertions, and reproducible Linux/local-Mac measurement support. Performance limits remain subject to separate owner approval.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 25, 2026 22:32
@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-25T22:32:24.268806Z
We couldn’t complete this review. Comment @codex review to try again.
21be180 PR opened
ℹ️ 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.

@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.

Keep the internal sample protocol in a basename-scoped temporary namespace with enumerated shapes. Validate descriptor path components with the existing digest_parts guard and reject traversal before metadata reads.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Inspection guards miss payload reads via builtins.open and Path.read_bytes() and credential lookup via RegistryClient’s imported binding, allowing prohibited operations to escape detection.

2 open issues
What changed in this PR

Adds offline regression and resource-measurement coverage for RegShape’s local OCI layout inspection under #216, without changing production SDK/CLI behavior or dependencies.

Changes:

  • Adds deterministic fixtures, including digest-pinned BusyBox metadata with minimal local payload stand-ins.
  • Tests SDK/CLI consistency, counts, limits, diagnostics, preservation and legacy compatibility.
  • Adds fresh-process resource measurements, Linux CI evidence retention and rerun documentation. Performance approval still requires owner-approved thresholds and passing reruns.
File Description
src/​regshape/​tests/​test_layout_inspection_integration.py Adds integrated inspection and compatibility regressions.
src/​regshape/​tests/​layout_inspection_fixtures.py Builds deterministic layouts and instruments inspection IO.
src/​regshape/​tests/​fixtures/​layout-inspection/​busybox-metadata.json Stores seven pinned public BusyBox metadata documents.
src/​regshape/​tests/​benchmark_layout_inspection.py Measures all four views and evaluates supplied resource thresholds.
docs/​library/​layout-inspection.md Explains fixture limitations, measurements and approved-threshold reruns.
.github/​workflows/​tests.yml Retains Linux measurements and extends minimum-Click and Windows selectors.

Review effort: Balanced

Guard builtins/io file opens and transport-bound credential lookup, with negative regressions. Workers inherit the owned fixture cwd instead of accepting paths. Retain Linux measurements before the longer full pytest step.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The tests lack independent stored-byte verification and complete I/O guards, while Linux peak-memory measurements can be inflated by retained parent allocations.

1 open issue
2 previously missed issues

In code that hasn't changed since last review

Medium severity Use post-exec Linux VmHWM to avoid inherited RSS inflation

src/​regshape/​tests/​benchmark_layout_inspection.py:136

On Linux, ru_maxrss can include memory inherited before exec, so retaining the prechecked SDK graph in measure() can inflate an otherwise unchanged child's reported peak. This makes Linux baselines and later RSS gates depend on the parent's memory usage. Read Linux's post-exec VmHWM, retain getrusage on macOS, and add a regression checking that a large retained parent allocation does not inflate the reported child peak.

Medium severity Use independent fixture sizes to verify stored-byte totals

src/​regshape/​tests/​test_layout_inspection_integration.py:122

This expected value repeats the exact calculation used by summarize_layout (summary.py:215), using the same SDK storage facts. If inspection caches an incorrect file size, both sides change together and this regression still passes. Compare the total against independent fixture file sizes so the stored-byte statistic is actually verified across this family, including shared and incomplete layouts.

1 resolved since last review

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The benchmark can inflate Linux worker memory measurements through an inherited ru_maxrss floor, making memory-cap validation unreliable until it uses the worker’s /proc/self/status VmHWM.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Medium severity Linux worker RSS measurement includes inherited parent memory

src/​regshape/​tests/​benchmark_layout_inspection.py:137

On Linux, ru_maxrss can retain a pre-exec RSS floor inherited from the parent rather than report only the worker's peak. Because measure() keeps the expanded SDK graph alive while launching workers, this can inflate the measurements used to approve memory caps. Read the worker's /proc/self/status VmHWM on Linux and retain getrusage on macOS.

2 resolved since last review

Review effort: Balanced

Guard pathlib cached opens on Python 3.10, verify stored-byte totals from fixture snapshots rather than SDK facts, and use Linux post-exec VmHWM with a retained-parent-allocation regression. Preserve macOS byte-unit getrusage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Owner-approved time/RSS thresholds and fresh Linux/local-macOS reruns remain pending, while the CI run predates the pathlib fix and cannot verify exact-head Python 3.10 compatibility.

No open issues 🎉

Review effort: Balanced

Bind Linux and local macOS limits to the approved fixture revision and recorded issue approval. Enforce Linux limits in the existing CI sampler and document local Mac reruns.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Human assessment is needed because duplicate native metadata reads can go undetected by the integration tests and resource harness.

No open issues 🎉

Review effort: Balanced

toddysm and others added 2 commits November 25, 2026 16:25
Count actual native metadata opens and track direct os.read bytes, including existing-handle rereads. Add sampler regressions that preserve SDK output while triggering the precise cache/byte-budget failures. Instrumentation revision renewal is required before publication with approved caps.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Retain owner-approved numerical caps and bind both platforms to the explicitly renewed instrumentation revision for #216.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Human assessment is needed because unaccounted positional reads and additional descriptor wrappers can let the sampler accept duplicate metadata I/O despite unchanged output.

No open issues 🎉

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Human assessment is needed because reads before _Stream attachment can go uncounted, allowing duplicate metadata reads to pass the sampler’s verification checks.

No open issues 🎉

Review effort: Balanced

toddysm and others added 2 commits November 25, 2026 17:13
Observe binary metadata reads before SafeFile construction and reuse the same observer in the SafeDirectory context. Preserve close/seek/context behavior and reject unobserved streams so early reads cannot pass the sampler gates for #216.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep every cap unchanged and bind both platforms to the explicitly approved factory-time observer revision for #216.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Human assessment is needed because worker failures can lose captured diagnostics and leave incomplete reports, obscuring the underlying correctness or I/O failure.

No open issues 🎉

Review effort: Balanced

Retain captured stdout/stderr, case and iteration plus partial measured evidence before raising an explicit worker failure for #216. IO instrumentation and approved fixture revision remain unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Human assessment is needed because a moderate finding omitted from the published review shows that repeated full-path stat calls can evade the sampler’s per-address cache check.

No open issues 🎉

Review effort: Balanced

toddysm and others added 2 commits November 25, 2026 17:46
Normalize supported pathname forms and route cached pathlib accessors through one observed native stat factory. Add eight sampler regressions for full-path stat/lstat observations and surface the cache-guard failure explicitly. Keep this changed instrumentation unpublished until numerical approval is renewed for #216.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Bind the unchanged Linux and Mac caps to explicitly renewed approval 7180329437 and corrected full-path stat/lstat fingerprint 20f129 for #216.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Human review is needed because the reported Linux/macOS resource passes predate the renewed stat/lstat observer, leaving final-revision verification against the updated limits unconfirmed.

No open issues 🎉

Review effort: Balanced

Comment thread .github/workflows/tests.yml Resolved
toddysm and others added 2 commits November 25, 2026 18:25
Include the entire benchmark driver in the approval fingerprint, validate thresholds before fixtures or worker processes, and run pytest before the always-run Linux resource gate. Add focused revision and invalid-threshold regressions for the three review findings on #226.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Bind both unchanged platform tables to full driver/builder/metadata revision 79bac092 and explicit owner approval 7204970937 for #216. No numeric values changed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Human assessment is needed because fixture helpers omitted from the fingerprint can change manifest digests without changing the revision, allowing threshold preflight to accept changed fixtures under an old approval.

No open issues 🎉

Review effort: Balanced

toddysm and others added 2 commits November 26, 2026 14:57
Include shared address and descriptor source in the approval fingerprint; add an input mutation regression and document the complete fixture source boundary.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Record owner approval 7205440161 for the four-source fixture/measurement fingerprint; preserve every Linux and local-Mac numerical cap.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Required final-head Linux and local macOS resource reports remain pending and cannot be validated here, so a human must verify them against the renewed limits before approval.

No open issues 🎉

Review effort: Balanced

@toddysm
toddysm merged commit 17f8271 into main Nov 26, 2026
12 checks 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.

Verify layout inspection end-to-end and compatibility regressions

3 participants