Skip to content

Docs: clarify @arg type vs signature type hint relationship - #44

Merged
nihilok merged 3 commits into
mainfrom
copilot/clarify-arg-type-relationship
May 4, 2026
Merged

Docs: clarify @arg type vs signature type hint relationship#44
nihilok merged 3 commits into
mainfrom
copilot/clarify-arg-type-relationship

Conversation

Copilot AI commented May 4, 2026

Copy link
Copy Markdown

The docs showed both @arg type keywords and signature type hints without explaining which wins, whether both are required, or what each one actually controls at runtime.

Changes

  • docs/attributes-and-interpreters.md — Updated the @arg bullet to note the type keyword is a fallback (not the primary driver), and added a blockquote callout spelling out the full precedence rules:

    • Signature type hint controls MCP JSON schema type and drives runtime value conversion in polyglot functions
    • @arg type is consulted only when there is no typed signature (legacy $1/$2-style shell functions)
    • @arg description is always used regardless
    • On conflict, signature type hint wins
  • docs/arguments.md — Added a summary sentence to the "Types in signatures" section with a cross-link to the detailed note above

Precedence in one glance

# @arg env string Target environment  ← fallback; ignored here because signature is typed
deploy(env: str, version = "latest") { ... }
#             ^^^^ primary: sets MCP schema type + polyglot runtime conversion

Copilot AI changed the title [WIP] Update documentation to clarify @arg and signature type relationship Docs: clarify @arg type vs signature type hint relationship May 4, 2026
Copilot finished work on behalf of nihilok May 4, 2026 20:54
Copilot AI requested a review from nihilok May 4, 2026 20:54
@nihilok
nihilok marked this pull request as ready for review May 4, 2026 20:58
@nihilok

nihilok commented May 4, 2026

Copy link
Copy Markdown
Owner

@copilot clippy is failing

Copilot AI commented May 4, 2026

Copy link
Copy Markdown
Author

@copilot clippy is failing

Fixed in 81ef41f — three duration_suboptimal_units errors in tests/mcp_server_test.rs (lines 549, 607, 997): replaced from_millis(1000)/from_millis(2000) with from_secs(1)/from_secs(2). Clippy now passes cleanly.

Copilot finished work on behalf of nihilok May 4, 2026 21:01
Copilot AI requested a review from nihilok May 4, 2026 21:01
@nihilok
nihilok merged commit cf2b540 into main May 4, 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.

Docs: @arg type and signature type hint relationship is ambiguous

2 participants