Fix the README claim checker for a CLI tool
Your task
An AI agent wrote the README for your team's Python CLI tool. It documented a --config flag, a DEBUG_LEVEL environment variable and pip install yourtool, and the repo has none of them. The agent filled the gaps with what CLI tools usually have. Before generated docs are merged, your team now checks every concrete claim against the code.
An assistant wrote unverified_claims(claims, real_flags, real_env_vars, published_packages). It is in the editor. It has a bug. Find it and fix it.
Input and output:
claims: the README's claims, each writtenkind=value, likeflag=--config.real_flags: the flags the CLI really defines.real_env_vars: the environment variables the source really reads.published_packages: the package names that are really published.- Return the claims that nothing supports, exactly as written, without repeats, sorted by plain character order.
Rules the tests check:
- Split a claim at its first
=into a kind and a value. - A
flagclaim is supported when its value is inreal_flags. Anenvclaim is supported when its value is inreal_env_vars. Apackageclaim is supported when its value is inpublished_packages. - Kinds and values are matched exactly: case matters and nothing is trimmed.
- A claim with any other kind, or with no
=at all, is unsupported. If you cannot check a claim, you do not vouch for it.
Examples
unverified_claims(claims: list[str], real_flags: list[str], real_env_vars: list[str], published_packages: list[str]) -> list[str]Example 1
Input
unverified_claims(["flag=--config", "env=DEBUG_LEVEL", "package=yourtool"], ["--verbose", "--input"], ["TOOL_HOME"], ["realtool"])Output
["env=DEBUG_LEVEL", "flag=--config", "package=yourtool"]Example 2
Input
unverified_claims(["flag=--verbose"], ["--verbose", "--input"], [], [])Output
[]Example 3
Input
unverified_claims(["env=TOOL_HOME", "package=realtool"], [], ["TOOL_HOME"], ["realtool"])Output
[]