Skip to content

fix(packaging): reject non-string manifest references - #296

Merged
briansuchy merged 2 commits into
google:mainfrom
kvishalv:reject-non-string-manifest-references
Nov 9, 2026
Merged

briansuchy merged 2 commits into
google:mainfrom
kvishalv:reject-non-string-manifest-references

Conversation

@kvishalv

@kvishalv kvishalv commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Contribution Type

Track: Bug Fix / Minor Patch

Summary of Key Changes

  • scripts/pack_plugin.py: build() now raises ValueError("Invalid manifest reference: ...") when a manifest reference is not a string. This covers entries in the agents list, icon, composerIcon and logo. Before, Path(reference) raised a bare TypeError (line 105). The check runs before the output folder is created, like the other manifest checks.
  • tests/unit/test_packaging.py: three parametrized tests (14 cases) check the exact message and that no output is created. The third, suggested by n3wth in review, covers composerIcon and logo in .codex-plugin/plugin.json, the manifest Codex reads.
  • docs/designs/runtime_packaging.md: one sentence now says the builder rejects non-string manifest references.

Why: the review of #229 noted that array element types stay unchecked and fail later in Path(reference) with a TypeError (comment). #195 and #229 set the contract that manifest problems raise ValueError. This closes the same gap for the other reference fields.

Not in this PR: a manifest where interface is not an object still raises AttributeError.

Size: 5 changed non-test lines, 0 files in skills/ or agents/.

Suggested label: tests. None of docs, site, ci or deps fits.

AI assistance: the patch and tests were drafted with Claude Code. I ran the tests locally; the results are below.

Human Accountability Affirmation

  • I am a human contributor. I have personally reviewed, understood, and can explain every line of this change in review (using AI tools to write code is welcome, but human understanding of the submitted change is required).

Verification

Unit tests and relative links: passed. On macOS with Python 3.12.0, at main 113a3af:

  • Before the fix, pytest tests/unit/test_packaging.py -k non_string gave 12 failed, each a TypeError from Path(reference) at scripts/pack_plugin.py:105. The 2 Codex manifest cases came later in review; n3wth confirmed that all 14 cases fail with scripts/pack_plugin.py from main.
  • At fe0f719, the same command gives 14 passed.
  • pytest tests/unit, which includes test_link_integrity.py, gives 350 passed and 2 skipped. The skips need EGM_COPILOT_OFFLINE and EGM_CURSOR_BUNDLE.

Design review (Stage 1): not applicable.

Native harness workflows (harness support): not applicable.

Other checks and limits: no host or workflow was run. This changes only the offline packaging script. Open PRs #292 and #293 also touch scripts/pack_plugin.py and tests/unit/test_packaging.py (for their own features, not this check). I did not rebase on them.

build() called Path() on every manifest reference. A non-string value
(a list entry in agents, icon, composerIcon or logo) raised a bare
TypeError. Raise ValueError("Invalid manifest reference: ...") before
any output is created, as for the other manifest checks.

Follows the review note on google#229, which left list entry types unchecked.
@kvishalv
kvishalv marked this pull request as ready for review November 4, 2026 05:14

@n3wth n3wth left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed 88998a0. The fix is right. Every reference goes through the one loop before output.mkdir, so one isinstance check there covers agent list entries, the Claude icon, and composerIcon and logo on both OpenAI manifests, and nothing gets written first. It's the same ValueError contract as #195 and #229. {reference!r} is the right choice here, since the value isn't a path. The doc line matches the code, and I agree on leaving a non-object interface for a separate change.

Nothing blocking. One [P3] inline: the tests don't touch .codex-plugin/plugin.json, which is the manifest Codex actually reads.

Please retitle to type(scope): summary, for example fix(packaging): reject non-string manifest references. Track 1 fits: two non-test lines, no core files.

I ran tests/unit locally at this head on Python 3.15: 348 passed, 2 skipped, same as the description. With scripts/pack_plugin.py from main, the 12 new cases fail. git diff --check is clean and this merges cleanly with main. cla/google, check-changes and the scope/template check pass.

Comment thread tests/unit/test_packaging.py Resolved
@kvishalv kvishalv changed the title Reject non-string manifest references when packaging fix(packaging): reject non-string manifest references Nov 4, 2026
build() also checks composerIcon and logo in .codex-plugin/plugin.json,
the manifest Codex reads. Pin the new reference check there too.

Co-authored-by: n3wth <5912894+n3wth@users.noreply.github.com>

@n3wth n3wth left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Re-reviewed at fe0f719. The only change since 88998a0 is my [P3] suggestion from last round, applied as written: test_rejects_non_string_codex_manifest_icons now sets composerIcon and logo to 5 in .codex-plugin/plugin.json, so the new check is pinned on the manifest Codex reads too. scripts/pack_plugin.py and the design doc line are unchanged, and the title follows type(scope): summary now.

I ran tests/unit at this head on Python 3.15: 350 passed, 2 skipped. All 14 non_string cases pass, and all 14 fail with scripts/pack_plugin.py from main. git diff --check is clean, it's on top of current main, and cla/google, check-changes and the scope/template check pass.

Non-blocking: the description still says two tests, 12 cases and 348 passed. It's three tests and 14 cases now, so it's worth updating before merge. Track 1 still fits: two non-test lines, no core files.

@kvishalv

kvishalv commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review and the Codex manifest test, appreciate it. I retitled the PR, added your test in fe0f719, and updated the description with the new counts.

@n3wth n3wth added docs Improvements or additions to documentation release Packaging, checksums, publishing, and distribution tests Changes to tests, fixtures, and validation labels Nov 6, 2026
@kvishalv

kvishalv commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

@n3wth thanks again for taking the time to review and approve this on Nov 4. I know you have other things on your plate. When you have a chance, could you approve the test workflow run, or let me know if anything else blocks the merge? I am happy to make any changes you would like before it merges.

@briansuchy
briansuchy merged commit 47db9c6 into google:main Nov 9, 2026
9 checks passed
Acrazie added a commit to Acrazie/elephant-goldfish-model that referenced this pull request Nov 20, 2026
* fix(review): save GoldfishContext URLs as files (google#289)

Co-authored-by: n3wth <5912894+n3wth@users.noreply.github.com>

* Propose the TRIZ inventive catalyst design specification (google#290)

Co-authored-by: Brian Suchy <briansuchy@google.com>

* docs(install): link the published desktop plugin (google#301)

* feat(agents): add the TRIZ inventive catalyst reviewer (google#299)

Co-authored-by: Brian Suchy <briansuchy@google.com>

* docs(site): propose the documentation architecture (google#304)

* docs(contributing): clarify the first contribution (google#330)

* docs(prs): simplify the pull request template (google#331)

* fix(plugin): separate publisher policy destinations (google#314)

* Configure Gemini Code Assist review threshold and styleguide (google#320)

* feat(plugin): update listing and prepare v0.1.1 (google#316)

* docs(plugin): define the listing presentation scope (google#305)

* feat(site): add documentation dependencies and primitives (google#306)

* Add displayName and logo to root plugin manifest (google#336)

Co-authored-by: Oliver Newth <n3wth@users.noreply.github.com>

* Route CODEOWNERS reviews through @google/egm-maintainers (google#340)

Co-authored-by: Brian Suchy <briansuchy@google.com>

* Harden pr-scope-advisory workflow for pull_request_target policy (google#341)

Co-authored-by: Brian Suchy <briansuchy@google.com>

* docs(readme): add the EGM explainer video (google#352)

* fix(site): preserve accessible names across screen sizes (google#357)

* fix(site): improve search metadata and favicon support (google#354)

* Bump PyYAML to 6.0.3 for Python 3.14 on Windows (google#339)

* fix(bootstrap): recognize more source file extensions (google#324)

* fix(packaging): reject non-string manifest references (google#296)

Co-authored-by: n3wth <5912894+n3wth@users.noreply.github.com>

* fix(tests): handle Windows cwd and blank output in Codex reads (google#297)

* Check the Copilot manifest version against plugin.json (google#311)

* Update stale reviewer profile count in Copilot entry agent (google#323)

* Fix casing in OpenCode reviewer prompt check (google#360)

* build(deps): bump actions/setup-python from 7.0.0 to 7.1.0 in the actions group across 1 directory (google#362)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fix the Claude marketplace plugin root for Cowork (google#347)

* Align brainstorm and review designs with shipped skills (google#343)

* Correct stale design statuses and bootstrap test instructions (google#348)

* build(deps-dev): bump pytest from 8.3.5 to 9.0.3 in the pip group across 1 directory (google#384)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Load analytics where cookie consent is not required (google#381)

* Add a Cursor marketplace catalog descriptor (google#377)

* State pull request title, label, and harness evidence rules in AGENTS.md (google#392)

* Add VS Code workspace discovery for Copilot (google#378)

* Add a brownfield quickstart and clarify .gitignore guidance (google#374)

* Delete committed Claude runtime before release branch exists (google#393)

* Write website skill pages for readers (google#395)

* Add Stage-1 GitHub Actions PR triage review and gate CODEOWNERS (google#380)

Co-authored-by: Brian Suchy <briansuchy@google.com>

* docs(site): add guide and skill page copy (google#401)

* feat(site): render docs from Markdown exports (google#402)

* Harden Stage-1 PR triage with pull_request_target and deterministic pre-checks (google#413)

Co-authored-by: Brian Suchy <briansuchy@google.com>

* Fix egm-bootstrap .NET detection for egm-bootstrap/SKILL.md (google#409)

* docs(windsurf): design experimental support (google#407)

* docs(contributing): clarify stacked PR workflow (google#400)

* refactor(site): share analytics component (google#403)

* feat(site): reuse header and styles on docs pages (google#404)

* feat(site): replace homepage with concise example (google#396)

* Set timeouts on the tests, deploy, and release jobs (google#424)

* Add OpenSSF Scorecard workflow (google#425)

* Publish the provenance bundle with release assets (google#426)

* Lint Python and workflow files in CI (google#427)

* Derive Claude root source in packaging (google#394)

* Add the EGM explainer video to the homepage (google#431)

* Align the explainer section with the two-column page grid (google#432)

* Add experimental Windsurf (Devin Desktop) adapter (google#379)

* build(deps): bump astro from 7.4.5 to 7.4.12 in /site (google#440)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fix bare-mention neutralization bypass via stray fence backtick (google#439)

Signed-off-by: Siddhardha Nanda <sn3199@columbia.edu>

* docs(designs): propose EGM Lite rapid engineering protocol (Stage 1) (google#419)

Co-authored-by: n3wth <5912894+n3wth@users.noreply.github.com>

* Align Claude manifest author with Google LLC directory entries (google#466)

* feat(skills): implement EGM Lite rapid engineering protocol (Stage 2) (google#438)

Co-authored-by: Oliver Newth <5912894+n3wth@users.noreply.github.com>

* docs(designs): record approved upstream sync design for 70406c4

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Siddhardha Nanda <sn3199@columbia.edu>
Co-authored-by: Aryan Atre <155140996+atrearyan@users.noreply.github.com>
Co-authored-by: n3wth <5912894+n3wth@users.noreply.github.com>
Co-authored-by: briansuchy <suchybrian@gmail.com>
Co-authored-by: Brian Suchy <briansuchy@google.com>
Co-authored-by: Oliver Newth <n3wth@users.noreply.github.com>
Co-authored-by: Yahya Sherif <120673276+Yahiasherif002@users.noreply.github.com>
Co-authored-by: Rishab Dugar Jain <rishabdugar.jain@gmail.com>
Co-authored-by: Vishal Kannankara <kvishalv@gmail.com>
Co-authored-by: wonseok-u <spark142857@gmail.com>
Co-authored-by: Rup Sarmah <84681565+sarmah-rup@users.noreply.github.com>
Co-authored-by: Akshat <akshat21shukla@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: mathewgeejo <mathewgeejo2006@gmail.com>
Co-authored-by: casali10 <63318448+casali10@users.noreply.github.com>
Co-authored-by: fouad <fouadsaidy@gmail.com>
Co-authored-by: Siddhardha Nanda <99672439+SID-6921@users.noreply.github.com>
Co-authored-by: Jonathan Njeunje <38731927+njeunje@users.noreply.github.com>
Co-authored-by: Acrazie <acrazie@acrazies-macbook-pro.home>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation release Packaging, checksums, publishing, and distribution tests Changes to tests, fixtures, and validation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants