codex icon indicating copy to clipboard operation
codex copied to clipboard

skill-creator: quick_validate accepts empty or whitespace-only required metadata

Open deepstorm1-maker opened this issue 3 days ago • 0 comments

Duplicate of openai/codex#44187. The earlier issue already tracks the same empty required-metadata defect. The independent pinned-source verification and 132-case follow-up have been consolidated in that issue: https://github.com/openai/codex/issues/44187#issuecomment-7285217769.

Summary

The bundled Skill Creator validator accepts empty or whitespace-only required name and description values as valid.

The same defect was originally reported in the now-deprecated openai/skills#535. This report records the finding against the current Codex-owned copy, where the defect remains present.

Affected source

codex-rs/skills/src/assets/samples/skill-creator/scripts/quick_validate.py

Inspected current main blob: a3b38c2270b7790621ff065de5c16b902a640489.

This is a bundled system-skill asset, not merely an external example: codex-rs/skills/src/lib.rs embeds src/assets/samples and install_system_skills installs the embedded directory under CODEX_HOME/skills/.system.

Reproduction

Create a directory containing this SKILL.md:

---
name: ""
description: ""
---
# Example
Follow the requested workflow.

Run from the repository root:

python3 codex-rs/skills/src/assets/samples/skill-creator/scripts/quick_validate.py <fixture-directory>

Actual result on the unmodified current source:

Skill is valid!

Exit code: 0.

The same defect occurs when either value contains only whitespace, including ASCII whitespace and Unicode whitespace removed by Python's str.strip().

Root cause

The validator strips each required field, then performs its remaining checks only inside a truthiness guard:

name = name.strip()
if name:
    # name format and length checks

description = description.strip()
if description.startswith("[TODO:"):
    ...
if description:
    # angle-bracket and length checks

If the value is empty after stripping, the guarded checks are skipped and validation reaches the success return.

Expected behaviour

Reject an empty or whitespace-only required field with a specific validation error.

The narrow correction is to check the stripped value immediately, then run the existing format and length checks unconditionally. Preserve the current UTF-8 file reading, TODO-placeholder checks, allowed frontmatter fields, and all other existing behaviour.

Proposed correction

name = name.strip()
if not name:
    return False, "Name must not be empty or whitespace-only"
# Existing name-format and length checks follow unconditionally.

description = description.strip()
if not description:
    return False, "Description must not be empty or whitespace-only"
if description.startswith("[TODO:"):
    return False, "Description contains an unfinished TODO placeholder"
# Existing angle-bracket and length checks follow unconditionally.

This avoids changing the initializer or silently inventing metadata defaults. It also avoids replacing the validator wholesale with a different implementation.

Validation

A focused 17-test unittest regression suite was run against the current source and the proposed patch in an isolated worktree.

Check Unmodified source Proposed patch
Focused regression tests 10 passed, 7 failed 17 passed
Empty/whitespace-only name and description Defect reproduced Rejected
Valid and existing-behaviour controls Passed Passed
Python compilation — Passed
git diff --check — Passed
git apply --check against clean baseline — Passed

The seven baseline failures are the empty/whitespace-only metadata cases and the CLI exit-code check. The tests also cover Unicode whitespace, non-string types, existing name/description constraints, optional metadata, and preservation of TODO-placeholder behaviour.

These are local focused tests; this report does not claim that the test suite was run in Codex CI.

Related reports and scope

  • openai/skills#535: original report against the deprecated repository and earlier copy of the validator.
  • openai/codex#37052: separate initializer/YAML-placeholder issue. The current initializer intentionally emits TODO placeholders, and the current validator intentionally rejects unfinished placeholders.
  • openai/codex#25548: separate documentation inconsistency concerning optional frontmatter fields.

This report is limited to empty required metadata. It does not propose changing TODO semantics, initializer output, supported frontmatter fields, or name-format policy.

Contribution context

The current Codex contribution guide says external code contributions and pull requests are not accepted, and asks community members to provide reproducible bug reports, root-cause analyses, and technical observations. This report follows that route; the proposed correction is included for maintainer review, not submitted as an external PR.

Independent blind verification (30 November 2026)

A separate review was completed against pinned Codex revision 6c7f53890f9078f375869e8d34ec6df70cc6bf55, before the reviewer consulted this issue. The validator blob was independently confirmed as a3b38c2270b7790621ff065de5c16b902a640489.

The review independently reproduced empty and whitespace-only name and description values, including ASCII and Unicode whitespace and empty block scalars. It distinguished these from missing fields and non-string YAML values, which already fail.

A separate 132-case CLI matrix reported:

  • Unmodified validator: 75/132 expectations met.
  • Two explicit non-empty guards: 92/132 expectations met.
  • All 17 targeted empty/whitespace-only cases were corrected by the narrow change.

The wider matrix also surfaced unrelated issues involving optional-field schema validation, name/directory consistency, YAML framing and duplicate keys, initializer quoting, and Markdown TODO detection. Those findings are deliberately excluded from this issue so that its acceptance criteria remain narrow and the fix does not accumulate unrelated compatibility changes.

Disposition remains unchanged: for this issue, the recommended correction is limited to rejecting each required field immediately after stripping when the result is empty, while preserving the existing checks and behaviour otherwise. The broader findings require separate triage and independent issue scopes.

The review was performed on a pinned source snapshot. It was not a full Codex build or CI run, and no upstream code was changed by the review.

deepstorm1-maker avatar Nov 30 '26 15:11 deepstorm1-maker