Skip to content

fix(id): validate app manifest field values (#4063) - #4082

Merged
dezren39 merged 1 commit into
mainfrom
queue/5971-4063-app-manifest-validation
Nov 2, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/5971-4063-app-manifest-validation

Conversation

@dezren39

@dezren39 dezren39 commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

Closes #4063. Queue task 5971 (repo-health-code-pilot).

parse_app_manifest was strict about manifest shape but barely checked field values. This change adds the missing value validation in pkgs/id/src/app_manifest.rs:

  • app.name and app.version must be non-blank.
  • An [interfaces.cli] section must list at least one command (an empty commands list no longer satisfies the at-least-one-interface rule), and command names must be non-blank.
  • capabilities.request entries must be non-blank; duplicates are rejected, not deduplicated — the manifest is the strict record of what an app asks for, and a repeat is an authoring mistake the gate should name (rule pinned by a test).
  • program.module_hash must be 1..=64 plain hex digits — the same rule as the world-apply manifest (world_manifest.rs, MAX_NAME_BYTES = 64).

Out of scope per the packet: resources.files confinement (#4059) and web route validation (#4060) are untouched; discovery behavior for present roots is unchanged.

Tests

  • New unit tests: rejects_blank_name_and_version, cli_interface_must_offer_a_real_command, rejects_blank_and_duplicate_capability_requests, module_hash_must_be_bounded_plain_hex.
  • Verified with a probe crate compiling a byte-identical copy of the edited app_manifest.rs (the creator-probe pattern): 8/8 tests pass — the 4 new tests plus all 4 pre-existing ones, including tic-tac-toe manifest parsing and discovery.
  • The checked-in tic-tac-toe app (pkgs/id/apps/tic-tac-toe/app.toml, web-only) satisfies the new rules.
  • Full cargo test --lib app_manifest (default features) running on the laptop worktree; result will be noted on issue id(app_manifest): strict-shape parser accepts blank/garbage field values — empty name/version, zero-command CLI interface, non-hash module_hash #4063. (A --no-default-features lib-test build fails pre-existing on main with E0432/E0433 feature-gated import errors, unrelated to this change.)

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

parse_app_manifest was strict about shape but not values. Now: app.name/app.version must be non-blank; an [interfaces.cli] section must list at least one command and command names must be non-blank; capabilities.request entries must be non-blank and duplicates are rejected (not deduplicated — a repeat is an authoring mistake the gate names); program.module_hash must be 1..=64 plain hex digits, the same rule as the world-apply manifest (world_manifest.rs). Unit tests cover each rejection; the checked-in tic-tac-toe manifest still parses.
@dezren39
dezren39 requested a review from a team as a code owner November 1, 2026 23:58
@coderabbitai

coderabbitai Bot commented Nov 1, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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 11 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 094acf17-4cc8-429b-8270-b045f5797a8c
Commits

Reviewing files that changed from the base of the PR and between 74a872a and 851e647.

Files selected for processing: 1
  • pkgs/id/src/app_manifest.rs
  • 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

@chatgpt-codex-connector

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

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-01T23:59:56.229360Z 851e647 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.

@dezren39
dezren39 merged commit 78b2bd2 into main Nov 2, 2026
4 checks passed
@dezren39
dezren39 deleted the queue/5971-4063-app-manifest-validation branch November 2, 2026 00:02
@dezren39
dezren39 restored the queue/5971-4063-app-manifest-validation branch November 8, 2026 04:21
@dezren39
dezren39 deleted the queue/5971-4063-app-manifest-validation branch November 8, 2026 13:21
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.

id(app_manifest): strict-shape parser accepts blank/garbage field values — empty name/version, zero-command CLI interface, non-hash module_hash

1 participant