Skip to content

Make inline dependency declaration a hard contract rule (WI-005)#8

Merged
datashaman merged 1 commit into
mainfrom
wi-005-verify-self-contained
May 21, 2026
Merged

Make inline dependency declaration a hard contract rule (WI-005)#8
datashaman merged 1 commit into
mainfrom
wi-005-verify-self-contained

Conversation

@datashaman
Copy link
Copy Markdown
Owner

What

Promotes the output contract's PEP 723 instruction from a parenthetical example to an explicit MUST, with a worked dependency-block example.

Why

Closing WI-005 required live verification of the "single self-contained file" case. Testing against the shipped Pydantic-AI backend (openai:gpt-4o) showed the model emitting non-stdlib imports (requests, pandas) with no PEP 723 block — two-for-two. The files were single but not self-contained: uv run would fail without manual installs.

Root cause: the contract only hinted at PEP 723 in a parenthetical. After this change, re-running the identical tasks produces correct inline metadata:

  • requests task → dependencies = ["requests"]
  • pandas task → dependencies = ["requests", "pandas"]

The companion case ("model chooses platform-appropriate language") passed as-is — bash for shell tasks, Python otherwise.

Verification

  • ruff + mypy clean, 74 tests pass
  • Growth verification runs logged pass for both WI-005 cases; WI-005 and parent deliverable WI-015 (mkscript v1) closed

🤖 Generated with Claude Code

The output contract instructed PEP 723 only as a parenthetical example, so
weaker models (verified with openai:gpt-4o) emitted non-stdlib imports with
no inline metadata — producing files that are single but not self-contained.

Promote it to an explicit MUST with a worked PEP 723 example. Re-running the
same requests/pandas tasks now yields correct `# /// script` dependency blocks,
satisfying the "single self-contained file" verification case.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@datashaman datashaman merged commit 2b41065 into main May 21, 2026
3 checks passed
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.

1 participant