Repository navigation
Conversation
Codex Review Summary: ❌ FailedThis 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. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[Medium impact] The latest follow-up appears safe to merge; it changes no runtime behavior. SummaryAdds read-only RPM inspection through CLI and MCP, with package metadata, dependencies, scriptlets, file inventory, and retained Evidence.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[CLI or MCP] --> B[Shared caller checks]
B --> C[Stable file read and hash]
C --> D[Bounded RPM parser]
D --> E[Evidence]
E --> F[Complete report]
E --> G[Retained summary view]
Reviews (36) · Last reviewed commit: "chore(rpm): explain diagnostic byte samp..." · Reviewed by Greptile |
…ection The RPM command restated its contract fields as hand-written incur options and mapped them back to contract input. Register it with registerContractCommand so its option schemas and decimal arguments derive from inspect_rpm_package and the command-parity test covers it. The contract projection gains an evidenceDelivery flag that adds the --detail and --evidence_output options and hands the delivery choice to the handler; deliverWithService delivers through the shared Evidence path. The parity test allows those delivery keys alongside the contract fields.
…lure path The RPM parser had its own RpmPackageFormatFailure class, hand-rolled bounds checks over raw Buffer reads, and a provider ladder that folded truncation into malformed. It now reads fields through BinaryReader and throws ParseFailureError (format "rpm"), so a short lead or a header whose index or data store runs past the file is reported as truncated, while inconsistent structure inside a present data store stays malformed. RpmPackageProvider projects those failures with parseFailureAnalysisError. The lead and signature facts decoded before a failure still reach the refusal: ParseFailure gains an optional observed fact, which parseFailureAnalysisError carries onto the invalid_format issue. Budget refusals keep RpmPackageCapacityFailure and their per-limit remediation. src/rpm/ joins the parser folders the architecture guards count.
The RPM CLI acceptance and MCP boundary tests now resolve inspect_rpm_package by name from RPM_PACKAGE_TOOL_CONTRACTS instead of importing the full tool catalog, per docs/development/testing.md.
STRING, STRING_ARRAY and I18NSTRING values were read with
toString("binary"), so UTF-8 summaries, file paths and scriptlets came
back as Latin-1 mojibake. Decode them as UTF-8 and keep each value's
stored byte length alongside it, so scriptlet byte counts and the
script budget still use the bytes in the data store.
The fixture encoder now writes UTF-8 instead of "binary", and a new
fixture with a non-ASCII summary, file path and scriptlet covers it.
The trigger loop paired TRIGGERNAME entries with TRIGGERSCRIPTS by position and never read TRIGGERINDEX. TRIGGERNAME lists conditions, not one name per script, so with names ["foo", "bar", "baz"] and indexes [0, 0, 1] the second script was labeled "bar" and a condition was lost. The parser now reads TRIGGERINDEX, refuses a missing, mismatched or out-of-range index as a malformed ParseFailureError, and groups every condition under the script it points to. The scriptlet row field is now a trigger_names list (null for non-trigger rows), with the schema, docs and tests updated, and a fixture covers indexes [0, 0, 1].
After the signature header decoded, the observing() wrapper kept only its location and entry count, so a truncated or malformed main header dropped the signature digests, size and blob presence that had already been read. The full signature observation is now built right after the signature header decodes and attached to any later failure, as AGENTS.md requires for completed observations. The payload digest still falls back to the main header in the finished report. A new fixture truncates the main header after a complete signature header, and its test asserts those fields survive in the error's observed facts.
SCRIPTLET_SENSE left out RPMSENSE_PRETRANS (0x80) and RPMSENSE_POSTTRANS (0x20), so a Requires(pretrans) or Requires(posttrans) row reported scriptlet_only: false and read like an ordinary runtime requirement. Add both sense bits to RPM_SENSE and the mask, and cover them with a parser fixture row for each.
When a dependency set had names but no flags tag, dependencies() invented flags: 0 and scriptlet_only: false, and file rows reported config: false and doc: false when FILEFLAGS was absent. Callers could not tell "not recorded" from "false". Report flags, comparison and scriptlet_only as null for dependency rows without a flags tag, and flags, config and doc as null for file rows without FILEFLAGS. The domain schema (and the contract output schema built from it) now allows those nulls, the guide documents them, and a parser test covers a package whose flags tags are absent.
The header getters returned undefined for a present tag whose stored kind did not match, so an in-bounds PREIN stored as INT32 decoded fine, was then treated as missing, and the report omitted that scriptlet while claiming complete coverage. parseHeader now checks every tag the report reads against a per-header spec of allowed types and, where RPM fixes it, the count (NAME, EPOCH, SIG_MD5 and siblings) before decoding, and refuses a mismatch through the shared ParseFailureError path as malformed, keeping signature facts in observed. The getters return undefined only for an absent tag and refuse any other kind. The separate MD5 length check is folded into the signature spec. New tests cover an INT32 PREIN fixture, a two-value EPOCH, and an 8-byte SIG_MD5.
Header strings were decoded with toString("utf8"), which silently
replaces invalid sequences with U+FFFD, so two different filename byte
sequences could produce the same reported path with no warning. The
separate byte count did not preserve the bytes themselves.
Header text now stays raw until a reader needs it and is decoded with a
fatal UTF-8 decoder. A value the report includes (a file path, package
field, dependency, or requested scriptlet text) that is not valid UTF-8
is refused as malformed through ParseFailureError, matching how the ZIP
and firmware readers refuse lossy names. The refusal names the tag and
entry index and quotes the raw bytes in hex, and keeps lead and
signature facts in observed. Tags the report never reads are no longer
decoded, and omitted scriptlet text still reports its stored byte
length. Tests cover a BASENAMES entry with a Latin-1 byte and a
scriptlet whose invalid text is refused only when requested.
rpm -qp reads a package file without installing it or running scriptlets. The spec now states the benefit as built-in inspection without RPM on the host, as the review suggested.
Main now carries its own Evidence delivery projection for contract commands, so the CLI projection files take main's version and inspect-rpm-package joins the parity test's command list. parseFailureAnalysisError keeps main's field parameter and this branch's observed facts. The advertised-dialect baseline that main added takes the counts the inspect_rpm_package input adds.
|
62b8c82 merges current main. Main now has its own Evidence delivery projection for contract commands, so |
Main now requires every top-level src unit in UNIT_LAYERS. src/rpm is a provider like src/sqlite, and its two type imports of application ports are recorded in the upward-import baseline the same way.
A present FILESIZES, FILEMODES, FILEDIGESTS, FILEFLAGS, FILEUSERNAME or FILEGROUPNAME array must hold one value per BASENAMES row, and a present TRIGGERSCRIPTPROG one per TRIGGERSCRIPTS entry. A mismatch is now a malformed refusal instead of null values that read as absent tags.
parseFailureAnalysisError now carries a ParseFailureError's observed facts onto AnalysisUnsupportedTargetError as diagnostics.observed, so an RPM whose lead names an unsupported signature type keeps the lead facts through CLI and MCP, as malformed and truncated refusals already do.
A header whose declared index and data store run past the end of the file is now refused as truncated before the max_header_index_entries budget is checked, so a corrupt count no longer suggests raising a budget that cannot supply the missing bytes.
Packages with large files store per-file sizes in LONGFILESIZES (5008, INT64). files() now prefers it and falls back to FILESIZES, and checks the chosen array against BASENAMES the same way.
The per-file and TRIGGERSCRIPTPROG mismatch refusals no longer set observed to the array length, which the detail already states, so observing attaches the lead and signature facts read before them.
Match failure.kind and failure.field, and the saved lead and signature facts, instead of the explanatory message text.
|
Main moved again, so fc790a0 merges the latest main into this branch. Main dropped src/cliCommandNames.ts and now declares each tool's CLI command and effects on its contract, so inspect_rpm_package takes |
A BASENAMES or other per-file array could declare millions of empty strings in a zero-filled store, and every value was built before the max_files budget was checked. Refuse a main-header per-file tag whose declared count is above max_files before decodeEntry reads it.
…lure rpmFailure and rpmFailurePrimary repeated the shared rules for file identity, cancellation, limits, paths and fallback errors. Route every raw failure through classifyProviderFailure with an RPM dialect that names only the parser format refusals and the budget refusals with their recovery text.
List tests/acceptance/rpmPackageCli.test.ts as the public-workflow case for the rpmPackage capability so the provider conformance suite covers it.
The RPM provider imported its port from the application layer, which the baseline allowance rpm -> application hid. Move the port beside the other provider ports, point the service and provider at it, and drop the allowance so the upward baseline is empty again.
|
Main moved again, so a8b7bf9 merges the latest main into this branch. The only conflict was the source test glob in scripts/lib/test-projects.mjs, where main added |
A main-header per-file tag whose declared count cannot fit in the bytes stored after its offset, such as FILEMODES with a count above max_files but one stored value, threw RpmPackageCapacityFailure and advised raising max_files. Placement and the minimum stored extent are now checked first, without reading or allocating the value, so that file is refused as malformed. The budget still runs before any rows are built.
Main now refuses new hand-built AnalysisResourceConstraintError copies (morluto#11456). The RPM provider reports the one limit it stopped at through decodeLimit and parseLimitConstraint, keeping its recovery advice, and the inspect_rpm_package advertised catalog summary picks up the output schema change from main.
Conflicts resolved: - scripts/verify-grok-client.mjs: main now pages native search_tool past the uint8 limit with bounded keyword queries, which covers the same catalog growth this branch handled; main's version is kept. - docs/index.md, docs/specs/README.md and the ko, th, zh and zh-TW READMEs: main's tables and lists are kept with the RPM package rows and links added back.
The stable-artifact consumer tests enroll every provider in the nested descriptor owner and recorded-cancellation cases. The RPM dialect had no readCleanup, so a read whose close failed lost its cleanupPrimary. It now reports the read's cleanup around the original physical failure or the recorded cancellation, bound to the read's descriptor leases.
|
b3cd308 merges the latest main into this branch: the client verifier script under scripts/ takes main's version, since main now pages search_tool past the uint8 limit the same way this branch did, and docs/index.md, docs/specs/README.md and the ko, th, zh and zh-TW READMEs keep main's tables with the RPM rows and links added back. 51ca8b1 then gives the RPM failure dialect a readCleanup, so a read whose descriptor close fails keeps the original failure or cancellation as its cleanup primary. |
Preserve the contributor history and current main registrations. Produce named parser limits before allocation, retain stable-file identity and exact cleanup owners, redact only transport URL userinfo, and record caller-selected inputs through CLI, MCP, retained views and late cancellation. Validate bounded source/public/lifecycle controls and compare the built tool against pinned official RPM producer fixture expectations without running rpm, installing packages, executing scriptlets or unpacking payloads. Assisted-by: Suika (gensokyo-skills:suika-scatter-gather-planning) Co-authored-by: gensokyo-dev <[email protected]>
Share element and decoded-text allowances across both RPM headers. Admit known vectors before allocation, decode stored text lazily once, and retain observed header facts with fixed parser refusals. Keep omitted script source undecoded. Cover tiny component quotas, parser producers and registered in-process MCP refusals, alongside ordinary compiled CLI/MCP and official-fixture comparisons. Assisted-by: Suika (gensokyo-skills:suika-scatter-gather-planning) Co-authored-by: gensokyo-dev <[email protected]>
gensokyo-dev
left a comment
There was a problem hiding this comment.
Reviewed the RPM integration and follow-up materialization ownership against the current contracts. Local targeted validation and the pinned producer-fixture CLI/MCP comparisons are documented, including the absence of a local rpm query, signature verification and real Windows execution. Exact-head CI remains required before merge.
Project the known URL's raw bytes through the shared transport URL owner before hex quoting a UTF-8 refusal. Preserve noncredential byte spelling, omit an ambiguous credential-bearing quote, and retain strict failure and file identity. Cover parser and actual CLI/MCP diagnostics with benign fixture credentials, plus working malformed-text comparisons for sibling metadata readers. Assisted-by: Suika (gensokyo-skills:suika-scatter-gather-planning) Co-authored-by: gensokyo-dev <[email protected]>
gensokyo-dev
left a comment
There was a problem hiding this comment.
Reviewed the final RPM integration and malformed-URL diagnostic correction. Credential filtering now occurs before raw-byte diagnostic projection, with strict refusal and snapshot provenance retained. Targeted source and actual CLI/MCP regressions passed; coverage limitations remain documented. Require final exact-head CI before merge.
Document the diagnostic prefix as a sample whose complete byte count is already reported, satisfying the architecture guard without changing runtime behavior. Assisted-by: Suika (gensokyo-skills:suika-scatter-gather-planning) Co-authored-by: gensokyo-dev <[email protected]>
gensokyo-dev
left a comment
There was a problem hiding this comment.
Reviewed the final RPM integration, credential-safe malformed-URL diagnostic and documented byte-prefix sample bound. Focused parser and actual CLI/MCP regressions, typecheck, changed lint and architecture guards passed; documented coverage limits remain. Final exact-head CI is required before merge.
Summary
Add
inspect-rpm-package/inspect_rpm_packagefor read-only inspection of one local RPM: lead/signature/header locations, package identity, dependencies, scriptlet presence, and header file inventory as retained Evidence. Script source is opt-in; payloads are not decompressed and signatures are not verified. No related issue exists; target-execution scope approval is not applicable.Contract and implementation
Validation
Coverage limits: the official producer fixture is not a locally executed
rpmquery or a distributor survey. Its homepage/scriptlet tags are absent; benign synthetic fixtures cover those fields. No installation, script execution, payload extraction, signature verification or real Windows execution was performed locally. Exact-head CI/review results will be recorded after completion.Author readiness
Human owner: @mvanhorn