Skip to content

feat(artifacts): inventory OCI image layouts offline - #12470

Merged
morluto merged 100 commits into
morluto:mainfrom
mvanhorn:feat/oci-image-layout
Nov 26, 2026
Merged

morluto merged 100 commits into
morluto:mainfrom
mvanhorn:feat/oci-image-layout

Conversation

@mvanhorn

Copy link
Copy Markdown
Contributor

Summary

Analysts receive OCI image-layout directories (oci-layout, index.json,
blobs/<alg>/<hex>) as evidence and previously had to walk the JSON by hand.
This adds inspect_oci_image_layout / inspect-oci-image-layout for the
directory form only. It reports layout version, index entries (media type,
digest, size, platform, annotations such as org.opencontainers.image.ref.name),
nested indexes within a bounded depth, image config facts, layers, and streamed
SHA-256 (and SHA-512 when declared) verification of present referenced blobs.
Env values stay omitted unless include_env_values is selected. Missing blobs,
digest and size mismatches, unreferenced blobs, unknown media types, unsupported
digest algorithms, symlink blobs, nested-index depth, malformed nested JSON, and
blob oversize are findings, not crashes. Layer contents are not decompressed
(follow-up). Tar image layouts are out of scope.

Problem and expected behavior

An operator-selected local directory that is an OCI image layout should be
inventoried offline without executing the image, contacting a registry, following
child symbolic links, or leaving the selected root. Oversize or malformed
oci-layout / index.json should refuse with partial facts when the layout
file was readable. Present referenced blobs should be hashed under a byte
budget. Defects in the layout should remain visible as findings.

Change and scope

A dedicated read-only artifact tool following the existing NuGet-style inspect
path: domain schema, directory-admitted parser, provider/port, application
service, CLI contract command, MCP binding, advertised schema, analysis view,
acceptance/MCP/conformance/lifecycle coverage, and the authored skill text.
Admission uses DirectoryArtifactReader and the stable-root helpers so child
symlinks and paths that leave the root are refused. JSON documents, hashed
blobs, directory entries, and nested index depth are bounded with named
allowances. Directory form only; tar input and layer decompression are not
included.

Follow the contribution scope.
Unresolved scope, authority, side effects, or required verification block
integration. Link the required maintainer scope decision for new providers or
capabilities involving target execution, injection, mutation, or protection
recovery; ordinary fixes within existing boundaries may state "not applicable".
Draft PRs may leave the scope decision pending and the readiness and merge checklists
unchecked. Maintainers can help resolve open questions.

Contract and boundary impact

  • Semantic owner and earliest changed stage:
    src/oci/OciImageLayoutParser.ts produces the inventory. Consumers are the
    OCI image-layout provider, application service, CLI command, MCP tool, and
    analysis-view projection. No superseded path is removed.
  • Contribution scope fit and linked maintainer decision:
    Read-only static inspection within existing artifact boundaries; no target
    execution, injection, mutation or protection recovery. Not applicable.
  • CLI and MCP/tool-catalog contract:
    New CLI inspect-oci-image-layout <dir> and MCP inspect_oci_image_layout.
    Advertised schema is under scripts/verify/advertised-schemas/tools/inspect_oci_image_layout.json.
  • Provider, bridge, target-format, or platform compatibility:
    In-process built-in reader. Directory form of the OCI image layout
    (imageLayoutVersion 1.0.0). No bridge, no registry, no daemon.
  • Evidence, artifact, provenance, or reconstruction contract:
    Evidence format directory with snapshot_sha256 over layout version and
    the SHA-256 of oci-layout and index.json. Summary delivery requires
    --evidence_output.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable):
    Caller-selected local directory. Child symlinks are not followed. No owned
    process and no host extraction outside the existing reader.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs and skills/; edit authored instructions in .agents/skills/reverse-engineer-anything/ and never commit build outputs):
    Authored skill text updated. Generated skills/ and docs/public/product-catalog.json are not in this commit.

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

The workflow reads an operator-selected local directory through the existing
directory admission helpers and records Evidence through the existing delivery
path. It does not launch a process, inject instrumentation, mutate the target,
contact the network, or recover protected code.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

Source-derived plus executed tests on Linux x64, Node v24.22.3.

  • Tests added or updated:
    Synthetic layouts in src/oci/OciImageLayoutParser.test.ts (valid
    single-platform, include_env_values, multi-platform index, missing blob,
    digest mismatch, size mismatch, symlink blob, oversize index JSON, nested
    index depth, malformed index JSON, unreferenced blob / unknown media type /
    unsupported digest). Service path/cancellation tests, analysis-view test,
    CLI acceptance, MCP boundary, absolute-path contract, conformance case, and
    in-process lifecycle coverage.
  • Base reproduction or other evidence:
    On untouched upstream/main (ebd709cef51ee0791ef9cf935da974fd51374e5d)
    rea inspect-oci-image-layout returns COMMAND_NOT_FOUND. After this change
    the same directory inventories layout_version 1.0.0; tampering one layer
    blob records digest_mismatch.
  • User-visible CLI/MCP output (if applicable):
    See the demo recording. Compact CLI JSON reports layout version, index
    entries, redacted Env, present layers, and findings.
  • Remaining proof gaps:
    Tar image-layout input and layer-content listing are out of scope. Tests and
    the demo use small scripted layouts, not a layout from a real image build. Windows
    unverified. Full npm run check:pr (typed lint, jscpd, knip:production,
    python tests, docs:check) was not run.

For boundary fixes, identify the applicable boundary regressions
and lifecycle regressions
covered by the evidence above, and explain relevant gaps.

MCP advertise + absolute-path refusal, CLI/MCP observation match, and
late-cancellation Evidence retention are covered. Launch/handshake/cleanup/retry
are not applicable for this in-process reader.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

Linux 6.12.113+ x86_64, Node v24.22.3, npm 11.19.1. Feature
270cb2196be2d9514772244eb106c900874d9db8 branched from
ebd709cef51ee0791ef9cf935da974fd51374e5d.

  • npm ci — pass (Node 24.22.3; host Node 22.23.2 is below engines)
  • npm run check:fast — pass (typecheck+lint; architecture guards 2908 files; 21.6 s)
  • npm run verify:test-discovery — pass (3817 files discovered exactly once)
  • npm run format:check — pass (8827 files)
  • npx vitest run src/oci/OciImageLayoutParser.test.ts src/application/oci/OciImageLayoutService.test.ts src/domain/analysisView/ociImageLayoutView.test.ts — 3 files, 19 passed
  • npx vitest run --project acceptance tests/acceptance/ociImageLayoutCli.test.ts tests/acceptance/tools/localToolContracts.test.ts — 2 files, 15 passed
  • npx vitest run --project mcp-boundary tests/boundary/mcp/ociImageLayoutMcp.test.ts tests/boundary/mcp/absoluteLocalPathTools.test.ts — 2 files, 4 passed
  • npx vitest run --project cli-boundary (contract parity, schema parity, tool coverage, help, manifests, JSON input, required inputs) — 7 files, 1120 passed
  • npx vitest run --project conformance tests/conformance/providerCapabilityConformance.test.ts — 1 file, 80 passed
  • npm run test:changed — 4 failed / 15744 passed / 25 skipped across 862 files. The four failures were Uf2ArtifactReader, WebBundleAnalysisWorker, and PyInstallerBoundaries (unrelated). Re-run of those three files: 86 passed
  • npm run knip — pass aside from two pre-existing unresolved worker imports (#web-bundle-analysis-worker, #javascript-analysis-worker)
  • npm run verify:advertised-schemas -- --update-summary — pass (inspect_oci_image_layout added)
  • node scripts/verify-grok-client.mjs — pass (catalogChecked true, catalogSize 261, schemasChecked 261)

Untouched upstream/main baseline (/tmp/rea-oci-baseline at ebd709c):

  • npm run check:fast — pass (architecture guards 2898 files; 20.9 s)
  • npm run verify:test-discovery — pass (3812 files)
  • npm run format:check — pass (8806 files)
  • npx vitest run src/nuget/NugetNupkgParser.test.ts src/application/nuget/NugetNupkgService.test.ts — 2 files, 42 passed
  • rea inspect-oci-image-layout — COMMAND_NOT_FOUND, exit 1

Compatibility, safety, and release

  • Breaking changes or migration steps:
    None. New CLI command and MCP tool only.
  • Real Hopper/Ghidra, browser, or OS coverage:
    Not applicable. Built-in directory reader. Demo layout assembled by script.
  • Package or release metadata impact:
    Authored skill text under .agents/skills/reverse-engineer-anything/ and
    .cursor-plugin/skills/. Generated skills/ and docs/public/product-catalog.json
    are not committed.
  • Security, privacy, process, or containment review:
    Read-only. Child symlinks are not followed. Env values default to null.
    Blob hashing is streamed under max_blob_bytes. JSON reads under
    max_json_bytes. Directory enumeration under max_entries. Nested indexes
    under max_index_depth.

Author readiness

Human owner: @mvanhorn

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

Demo

demo

Full recording (MP4): https://raw.githubusercontent.com/mvanhorn/pr-demo-assets/main/osc-bulk-1119/oci-image-layout/out.mp4

OCI image-layout directories (oci-layout, index.json, blobs/) arrive as evidence and previously required walking the JSON by hand.

This adds inspect_oci_image_layout / inspect-oci-image-layout for the directory form only. It reports layout version, nested indexes, image config facts, layers, and streamed SHA-256 (and SHA-512 when declared) verification of present referenced blobs. Env values stay omitted unless include_env_values is selected. Missing blobs, digest and size mismatches, unreferenced blobs, unknown media types, unsupported digest algorithms, and symlink blobs are findings. Layer contents are not decompressed.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

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-26T18:26:48.415310Z
We couldn’t complete this review. Comment @codex review to try again.
0a5b352 New commits
ℹ️ 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.

@greptile-apps

greptile-apps Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 4/5 · The two existing budget-contract requirements still need to be satisfied before merging.RetriggerView in GreptileConfidence Score: 4/5 Tier: plus

[Medium impact] The new capability reads operator-selected local OCI layout directories through CLI and MCP.

The two existing budget-contract requirements still need to be satisfied before merging.

Findings

  1. P2 Budget retries still fail ▶
  2. P2 Budget choices cannot persist ▶
Fix with agent prompt
### Issue 1
src/oci/OciImageLayoutProvider.ts:131-132
`required_value` receives a running count, not the amount needed to finish. A layout with seven entries inspected with `max_entries: 1` reports `required_value: 2`, but retrying with 2 fails again. Descriptor and retained-byte limits have the same problem.

The repository requires lower bounds to stay in `reported_limits`, with `required_value` omitted until the full need is known. Keep the typed budget fields, but distinguish measured totals from unfinished counts. This requirement must be satisfied before merging.

### Issue 2
src/domain/oci/imageLayout.ts:200-218
The new count and retained-byte budgets are per-call only. `parameterBudgetSchema` fills fixed defaults, and no registered setting covers OCI inspection. Analysts inspecting several large layouts must resend the same overrides on every call.

The tool-design guide requires session settings for limit families that an agent may raise repeatedly. Connect these controls to shared or new session defaults. Explicit per-call values should still win, and omitted fields should stay omitted in Evidence. This repository requirement must be satisfied before merging.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Adds offline OCI image-layout inspection through CLI and MCP, with bounded reads, blob hashes, findings, and retained summary views.

  • OCI image-layout directories now yield bounded index, image, and blob reports.
  • CLI and MCP callers can inspect OCI directories and retain the result as Evidence.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  CLI[CLI command] --> Service[Shared inspection service]
  MCP[MCP tool] --> Service
  Service --> Provider[OCI provider]
  Provider --> Reader[Directory reader]
  Reader --> Parser[Bounded OCI parser]
  Parser --> Report[Inventory and findings]
  Report --> Evidence[Evidence]
  Evidence --> Complete[Complete result]
  Evidence --> Summary[Retained summary and paging]
Loading

Reviews (85) · Last reviewed commit: "Merge branch 'main' into feat/oci-image-..." · Reviewed by Greptile

Comment thread src/domain/oci/imageLayout.ts Resolved
Comment thread src/oci/OciImageLayoutParser.ts Resolved
Comment thread src/oci/OciImageLayoutParser.ts Resolved
Comment thread src/oci/OciImageLayoutParser.ts Resolved
Comment thread src/oci/OciImageLayoutParser.ts Resolved
Comment thread src/oci/OciImageLayoutParser.ts Resolved
Comment thread src/oci/OciImageLayoutParser.ts Resolved
Comment thread src/oci/OciImageLayoutParser.ts Resolved
Comment thread src/oci/OciImageLayoutParser.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 270cb2196b

ℹ️ 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".

Comment thread src/domain/oci/imageLayout.ts Resolved
Comment thread src/oci/OciImageLayoutProvider.ts Resolved
Comment thread src/oci/OciImageLayoutParser.ts Resolved
Comment thread src/oci/OciImageLayoutParser.ts Resolved
Comment thread src/oci/OciImageLayoutParser.ts Resolved
Comment thread src/domain/oci/imageLayout.ts Resolved
Comment thread src/oci/OciImageLayoutParser.ts Resolved
Keep config facts such as WorkingDir exactly as written instead of
returning their trimmed form. Blank values still count as absent.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6c7284ac83

ℹ️ 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".

Comment thread src/oci/OciImageLayoutParser.ts Resolved
Comment thread src/oci/OciImageLayoutParser.ts Resolved
Comment thread src/oci/OciImageLayoutParser.ts Resolved
Comment thread src/oci/OciImageLayoutParser.ts Resolved
The OCI image index stores a platform version under the literal
"os.version" member, so Windows entries that share OS and architecture
keep the build that tells them apart.
Env values are bytes from the selected image, and AGENTS.md asks to
preserve local evidence without inferring secrecy from names. The
include_env_values control now defaults to true; false still leaves each
value null and keeps the names.
Comment thread src/domain/oci/imageLayout.ts Resolved
An index, layer or config descriptor without a string mediaType or digest
was dropped with no diagnostic, so an index of only malformed descriptors
read as an empty, fully covered index. Each such descriptor now records a
malformed_blob_json finding naming its position, what it lacks and any
digest it carries.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 896fea7ecc

ℹ️ 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".

Comment thread src/oci/OciImageLayoutParser.ts Resolved
Comment thread src/oci/OciImageLayoutParser.ts Resolved
Comment thread src/oci/OciImageLayoutParser.ts Resolved
Comment thread src/oci/OciImageLayoutParser.ts Resolved
The index walk was depth-first with a visited set that ignored depth, so
an index shared between a nested path and the root was first visited too
deep, and what it reached within max_index_depth was never inventoried.
Indexes now queue breadth-first, so each is first reached at the
shallowest depth any path gives it.
When several descriptors referenced one blob with different sizes,
remember kept only the first declaration, so a wrong later size was
never checked. Each referenced blob now keeps every distinct declared
size, and the file-size and hashed-byte checks run against each one.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 886cd76e8e

ℹ️ 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".

Comment thread src/oci/OciImageLayoutParser.ts Resolved
Comment thread src/oci/OciImageLayoutParser.ts Resolved
A referenced index, manifest or config that was a symlink, or otherwise
could not be read, left its facts unexamined while coverage still read
complete. Any skipped referenced JSON read now makes coverage partial,
whatever finding explains it.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 223260dfa6

ℹ️ 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".

Comment thread src/oci/OciImageLayoutParser.ts Resolved
@mvanhorn

Copy link
Copy Markdown
Contributor Author

Main moved, so 97d3b9f merges it in. The only conflict was the vitest project glob in scripts/lib/test-projects.mjs, where this branch added oci and main added uefi; both are kept.

Comment thread src/oci/OciImageLayoutParser.ts Resolved
Comment thread src/oci/OciImageLayoutProvider.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 97d3b9f375

ℹ️ 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".

Comment thread src/oci/OciImageLayoutParser.ts Resolved
Comment thread src/oci/OciImageLayoutParser.ts Resolved
A layer whose digest used an unsupported algorithm got no finding and
was recorded as a missing blob, even when its file existed, and coverage
could read complete. Every referenced digest with an unsupported
algorithm now records unsupported_digest_algorithm, its blob record
reflects the file at blobs/<algorithm>/<encoded>, and such a finding
makes coverage partial.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 134b55e26f

ℹ️ 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".

Comment thread src/domain/oci/imageLayout.ts Resolved
Comment thread docs/getting-started/cli.md Resolved
The provider's finally replaced the parse result with a cleanup failure
that always claimed the parse completed, so a refusal, cancellation or
integrity failure and its layout snapshot were lost when closing the
reader also failed. The parse outcome is now captured first; a failed
parse stays the primary error, with its partial facts, and the cleanup
failure is attached to it.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e23c9b61df

ℹ️ 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".

Comment thread src/oci/OciImageLayoutParser.ts Resolved
@mvanhorn

Copy link
Copy Markdown
Contributor Author

Main moved again, so 9d347a0 merges it in; the only conflicts were docs/README.md, docs/index.md and docs/specs/README.md, where I kept main's versions and re-added the OCI guide and spec links. 0224f3e then lines the CLI acceptance test, CLI help, tool contract text and the CLI getting-started doc up with the include_env_values default from aa19ad0.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0224f3e48e

ℹ️ 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".

Comment thread src/oci/OciImageLayoutParser.ts Resolved
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@morluto

morluto commented Nov 24, 2026

Copy link
Copy Markdown
Owner

@mvanhorn thanks for the PR — there are 8 open review threads here:

Could you address or reply to these? Once they're resolved and CI is green we can take another look.
cc @gensokyo-dev @dandgabr

Indexes and manifests whose schemaVersion is omitted, not a number, or a
number other than 2 now get a malformed_blob_json finding and partial
coverage, while their entries, config and layers stay readable.

Index entry annotations now spend max_descriptor_bytes as each
{name, value} record is built, charged at its serialized size, so many
short or empty annotations can no longer retain far more than their text
was charged for.
@mvanhorn

Copy link
Copy Markdown
Contributor Author

Pushed d61110b with the last two: schemaVersion validation (r4651918837) and annotation records charged before allocation (r4658997859), both with tests. Indexes and manifests with an omitted, non-numeric, or non-2 schemaVersion now get a malformed_blob_json finding and partial coverage while their entries stay readable, and index entry annotations now spend max_descriptor_bytes per {name, value} record at its serialized size.

The other six were fixed in c9e48ac: reader failures propagate instead of being reported as malformed JSON (r4637101957), the CLI docs say Env values are included by default (r4637508333), an omitted required manifest config is diagnosed (r4640807748), config facts are charged at their expanded size rather than raw document bytes (r4645714127), retained text from accepted descriptors is bounded (r4651918835), and the reader's examined-entry count is preserved (r4656740264).

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

Comment thread src/oci/OciImageLayoutParser.ts Resolved
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

Resolve parseFailureAnalysisError onto the TargetFailure model: keep the
options parameter and return AnalysisTargetFailureError, and update the
OCI parser test to the renamed error tag.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@mvanhorn

Copy link
Copy Markdown
Contributor Author

Merged current main into the branch in 715e4cc. The only conflict was in src/domain/parseFailureAnalysisError.ts from the AnalysisTargetFailureError rename, resolved to the new name, and the OCI and parse-failure tests pass locally. Before that, d5044ce documented how annotation records count against max_descriptor_bytes in the OCI image layout guide.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@mvanhorn

Copy link
Copy Markdown
Contributor Author

Main moved again, so 771606b merges it in. The only conflict was src/domain/parseFailureAnalysisError.ts: I took main's version, where unsupported failures come back as AnalysisTargetFailureError, and kept this branch's optional options argument so OciImageLayoutProvider still passes its partial layout observation through. npm run typecheck and the parse-failure and OCI Vitest suites pass on the merge.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

Comment thread src/oci/OciImageLayoutProvider.ts Resolved
Comment thread src/oci/OciImageLayoutParser.ts Resolved
@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.

@morluto
morluto enabled auto-merge (squash) November 26, 2026 18:14
@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.

Comment on lines +131 to +132
...(typeof limit.required === "number"
? { required_value: limit.required }

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.

P2 Budget retries still fail

required_value receives a running count, not the amount needed to finish. A layout with seven entries inspected with max_entries: 1 reports required_value: 2, but retrying with 2 fails again. Descriptor and retained-byte limits have the same problem.

The repository requires lower bounds to stay in reported_limits, with required_value omitted until the full need is known. Keep the typed budget fields, but distinguish measured totals from unfinished counts. This requirement must be satisfied before merging.

Context Used: AGENTS.md (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/oci/OciImageLayoutProvider.ts
Line: 131-132

Comment:
**Budget retries still fail**

`required_value` receives a running count, not the amount needed to finish. A layout with seven entries inspected with `max_entries: 1` reports `required_value: 2`, but retrying with 2 fails again. Descriptor and retained-byte limits have the same problem.

The repository requires lower bounds to stay in `reported_limits`, with `required_value` omitted until the full need is known. Keep the typed budget fields, but distinguish measured totals from unfinished counts. This requirement must be satisfied before merging.

**Context Used:** AGENTS.md ([source](https://github.com/morluto/rea/blob/main/AGENTS.md))

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

@morluto
morluto merged commit 6a6e7b0 into morluto:main Nov 26, 2026
51 checks passed
Comment on lines +200 to +218
max_entries: parameterBudgetSchema(
OCI_IMAGE_LAYOUT_BUDGETS.max_entries,
).describe(
"Maximum directory entries to examine; exceeding the budget fails without partial success",
),
max_descriptors: parameterBudgetSchema(
OCI_IMAGE_LAYOUT_BUDGETS.max_descriptors,
).describe(
"Maximum index, manifest and layer descriptors to decode across the layout, counted per reference so shared layers count once per manifest; exceeding the budget fails without partial success",
),
max_config_bytes: parameterBudgetSchema(
OCI_IMAGE_LAYOUT_BUDGETS.max_config_bytes,
).describe(
"Maximum serialized bytes of config-derived image facts across the layout, counted once per image so a shared config counts once per manifest that uses it (default 64 MiB); exceeding the budget fails without partial success",
),
max_descriptor_bytes: parameterBudgetSchema(
OCI_IMAGE_LAYOUT_BUDGETS.max_descriptor_bytes,
).describe(
"Maximum bytes charged for descriptor text retained across the layout: index entry digests, media types, platforms and annotations, accepted subject, config and layer digests and media types counted once per referencing manifest or index, the digest text findings retain for rejected descriptors, and the unknown media types findings quote from a document's own mediaType. Annotations are charged as serialized JSON {name, value} records, including keys, escapes and separators between records. Other descriptor text is charged as UTF-8 bytes (default budget 64 MiB); exceeding the budget fails without partial success",

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.

P2 Budget choices cannot persist

The new count and retained-byte budgets are per-call only. parameterBudgetSchema fills fixed defaults, and no registered setting covers OCI inspection. Analysts inspecting several large layouts must resend the same overrides on every call.

The tool-design guide requires session settings for limit families that an agent may raise repeatedly. Connect these controls to shared or new session defaults. Explicit per-call values should still win, and omitted fields should stay omitted in Evidence. This repository requirement must be satisfied before merging.

Context Used: AGENTS.md (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/domain/oci/imageLayout.ts
Line: 200-218

Comment:
**Budget choices cannot persist**

The new count and retained-byte budgets are per-call only. `parameterBudgetSchema` fills fixed defaults, and no registered setting covers OCI inspection. Analysts inspecting several large layouts must resend the same overrides on every call.

The tool-design guide requires session settings for limit families that an agent may raise repeatedly. Connect these controls to shared or new session defaults. Explicit per-call values should still win, and omitted fields should stay omitted in Evidence. This repository requirement must be satisfied before merging.

**Context Used:** AGENTS.md ([source](https://github.com/morluto/rea/blob/main/AGENTS.md))

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: evidence Evidence, artifacts, and reconstruction enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants