Skip to content

Libraries: add a library's requirements to the Application automatically - #157

Draft
rjhuijsman wants to merge 2 commits into
mainfrom
rjh.library-requirements
Draft

Libraries: add a library's requirements to the Application automatically#157
rjhuijsman wants to merge 2 commits into
mainfrom
rjh.library-requirements

Conversation

@rjhuijsman

Copy link
Copy Markdown
Contributor

Important

This PR was written by an agent and has not yet been reviewed by its author. It is a draft awaiting author review before peer review.

Before this PR, a library declared what it built on through requirements(), and Application used that only to refuse to start when something was missing, so an application had to list libraries=[oauth_library(), ciphertext_library(), ordered_map_library()] to use the OAuth token manager, and [queue_library(), sorted_map_library()] to use a queue. Every docs page and plugin skill for those libraries then had to explain what each one was built on, and getting the list wrong only showed up at startup. Now Application constructs the requirements itself, transitively, so libraries=[oauth_library()] is enough, and the pages and skills say so.

  • Libraries: add a library's requirements to the Application automatically. Library records every subclass by name as it is defined, and Application walks each listed library's requirements(), constructing (with defaults) any it can and adding their requirements in turn. A library the application lists itself is kept, so an application still customizes a dependency, for example with an authorizer, by listing its own instance. A requirement Reboot cannot construct, because nothing registered that name or its constructor needs arguments, still fails at startup, now naming the library that needed it. The store_tokens=True check asks for oauth_library() alone. Tests cover the added, transitive, listed-instance, unknown, and needs-arguments cases.
  • Docs: list only the library an application uses. The oauth, ciphertext, queue, and pubsub pages' Python examples list one library, the overview says requirements come along, and the plugin skills for those libraries stop telling agents to register the dependencies by hand.

Only the Python Application resolves requirements. The TypeScript Application never checked them, and the TypeScript standard-library modules declare none, so the TypeScript examples still list every library and the pages say so.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Votcp4rQnqt25q6XJGNavW

…cally

Before this change, `Application` used a library's `requirements()` only to refuse to start when one was missing, so using the OAuth token manager meant listing `oauth_library()`, `ciphertext_library()`, and `ordered_map_library()`, and using a queue meant listing the sorted-map library too: what each library was built on was the application's problem to know. Now `Library` records every subclass by `name` as it is defined, and `Application` walks each listed library's requirements, constructing any it can with defaults and adding their requirements in turn, so listing a library is enough to run it. A library the application lists itself is kept, which is how an application still customizes a dependency, e.g. with an authorizer. A requirement Reboot cannot construct, because nothing registered that name or its constructor needs arguments, still fails at startup, now naming the library that needed it.

- The `store_tokens=True` check asks for `oauth_library()` alone.
- Tests cover the added, transitive, listed-instance, unknown, and needs-arguments cases.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Votcp4rQnqt25q6XJGNavW
Before this change, the `oauth`, `ciphertext`, `queue`, and `pubsub` pages, and the plugin skills for those libraries, told readers to register each library's dependencies by hand and explained what each was built on, because `Application` required it. Now that a library's requirements come along automatically in Python, the Python examples list the one library the application uses, the overview says so, and the skills stop instructing agents to add the dependencies. The TypeScript examples still list every library, since the TypeScript `Application` never resolved requirements.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Votcp4rQnqt25q6XJGNavW
@aviator-app

aviator-app Bot commented Sep 9, 2026

Copy link
Copy Markdown

Current Aviator status

Aviator will automatically update this comment as the status of the PR changes.
Comment /aviator refresh to force Aviator to re-examine your PR (or learn about other /aviator commands).

This pull request is currently open (not queued).

How to merge

To merge this PR, comment /aviator merge or add the mergequeue-ready label.


See the real-time status of this PR on the Aviator webapp.
Use the Aviator Chrome Extension to see the status of your PR within GitHub.

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.

2 participants