RFC: External type definitions (J2) - #31
Merged
Merged
Conversation
Turns registry.md §5 (definition format), §7 (resolution/locking) and §8.3 (conflict order) into a committed contract: typr-def.toml manifests, since/until on FunctionMeta, external .ty loading gated by a project-configured trust threshold that degrades to Any (never a hard error), typr.lock, and typr types add/update/list/vendor. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ETPqhgWqDMt7UaUQXdxJmN
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ETPqhgWqDMt7UaUQXdxJmN
Status: draft -> accepted, file renamed to its assigned PR number (0031) per rfcs/README.md's process. Tracking issue to follow in a separate commit once opened. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ETPqhgWqDMt7UaUQXdxJmN
10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Proposes the second milestone (J2) of the type-registry design in
typR/registry.md: a TypR project can pin a third-party.tyfile asthe type description of an R package, at a configurable trust
threshold (
T1/T2/T3), with a hard invariant — an untrusted orwrong external definition can only make TypR check less (degrade to
Any), never turn a correct program into a build failure.Turns
registry.md§5 (definition format), §7 (resolution/locking)and §8.3 (conflict order) into a committed contract:
typr-def.tomlmanifest,format_version-gatedsince/untiladded toFunctionMeta(stdlib_meta.rs).tyloading merged intostandard_library.rs's contextbuild, keyed by
typr.locktrustthreshold + degrade-to-UnknownFunctionat merge time(builds on the now-variadic
UnknownFunctionfrom RFC 0028)typr types add|update|list|vendor,typr.lock, digest-verifiedcache
[capabilities]gate for any definition shipping executableR (shims,
extern r#"..."#)Explicitly excludes the registry service itself (J3+) — this only
specifies what's needed to consume a definition via
typr types add <repo>.Status
draft, perrfcs/README.md's process. Filename keeps the0000placeholder; it's the PR's own number once accepted.
Test plan
RFC's own "Implementation checklist" section, to follow after
acceptance
🤖 Generated with Claude Code
https://claude.ai/code/session_01ETPqhgWqDMt7UaUQXdxJmN