Disclosure policy for extension authors
Choose a disclosure marker for each extension file before publishing the package. The site generator and agent inspection tools use it to decide which signatures, docstrings, and source can appear. The marker applies to documentation and preview output. Filesystem access and package execution have separate controls.
| Marker | Public documentation | Agent source preview |
|---|---|---|
public |
Supported interfaces and examples | Approved implementation source |
api-only |
Signatures, public docstrings and supported behavior | Synthesized interface; implementation omitted |
hidden |
Omitted, including discovery and references | Omitted |
Python uses # @disclosure api-only; JavaScript and TypeScript use
// @disclosure api-only. Put a file default in the leading comment header.
A blank line ends that header. Put a declaration marker immediately above the
class, function, method or field, before any decorators. A class's policy applies
to its members. Nested markers can only tighten restrictions: public to
api-only to hidden. Imports and aliases do not grant additional access.
Malformed, conflicting, weakening or unattached markers fail validation.
# @disclosure public
"""Reusable meter components."""
# @disclosure api-only
class Meter:
"""A meter with a configurable value."""
def set_value(self, value: float):
"""Set the displayed value."""
...
# @disclosure hidden
def _private_helper(self):
...
Write docstrings as public contracts: arguments, units, return values, supported
behavior and runnable examples. Do not describe private implementation details.
A public signature or generated reference must not mention a hidden symbol.
Handwritten guides need their own review; a marker cannot remove descriptions
copied into another document. A Markdown document may begin with
<!-- @disclosure hidden --> to exclude the whole document from agent retrieval.
Core implementation defaults to hidden; supported core API modules are explicitly
api-only. User-owned extensions can expose their own source. Built-in extension
source additionally needs operator approval. A package cannot grant itself that
approval by adding a marker. Runtime source is never available through extension
source previews.
Source preview line numbers address synthesized, filtered text. They are not original file coordinates and the preview is not intended as executable source. Use the public API view for complete contracts and the source view to understand approved implementation examples.