Skip to content

Update docstrings and fix README#51

Merged
h3xxit merged 5 commits intomainfrom
dev
Aug 26, 2025
Merged

Update docstrings and fix README#51
h3xxit merged 5 commits intomainfrom
dev

Conversation

@h3xxit
Copy link
Copy Markdown
Member

@h3xxit h3xxit commented Aug 26, 2025

Summary by cubic

Standardized REQUIRED docstrings across core and plugins and added an automated extractor to generate Docusaurus docs. Also fixed README typos and migration guide inconsistencies.

  • New Features

    • Added scripts/extract_required_docs.py to scan REQUIRED docstrings and output Docusaurus markdown.
    • Expanded and normalized REQUIRED docstrings for serializers, auth, call templates, client, repositories, search, variable loaders/substitution, and communication protocols.
  • Bug Fixes

    • Corrected README wording, typos, numbering, and field names (e.g., tool_call_template).

edujuan and others added 5 commits August 21, 2025 14:32
- Fix numbering format in migration guide (6. instead of 6)
- Fix typo: 'subsituted' -> 'substituted'
- Correct field name in JSON examples: 'call_template' -> 'tool_call_template'
- Update migration guide description to use correct field name
- Ensure consistency between documentation and actual implementation
docs: fix README inconsistencies and typos
@h3xxit h3xxit merged commit d28dc58 into main Aug 26, 2025
25 checks passed
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

37 issues found across 41 files

React with 👍 or 👎 to teach cubic. You can also tag @cubic-dev-ai to give feedback, ask questions, or re-run the review.


class TextCommunicationProtocol(CommunicationProtocol):
"""Communication protocol for file-based UTCP manuals and tools."""
"""REQUIRED
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docstring includes placeholder text 'REQUIRED'; remove it so the summary is clean and suitable for generated docs.

Prompt for AI agents
Address the following comment on plugins/communication_protocols/text/src/utcp_text/text_communication_protocol.py at line 29:

<comment>Docstring includes placeholder text &#39;REQUIRED&#39;; remove it so the summary is clean and suitable for generated docs.</comment>

<file context>
@@ -26,7 +26,8 @@
 logger = logging.getLogger(__name__)
 
 class TextCommunicationProtocol(CommunicationProtocol):
-    &quot;&quot;&quot;Communication protocol for file-based UTCP manuals and tools.&quot;&quot;&quot;
+    &quot;&quot;&quot;REQUIRED
+    Communication protocol for file-based UTCP manuals and tools.&quot;&quot;&quot;
 
</file context>


class DefaultVariableSubstitutor(VariableSubstitutor):
"""Default implementation of variable substitution.
"""REQUIRED
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docstring starts with a placeholder 'REQUIRED' instead of a meaningful one-line summary.

Prompt for AI agents
Address the following comment on core/src/utcp/implementations/default_variable_substitutor.py at line 22:

<comment>Docstring starts with a placeholder &#39;REQUIRED&#39; instead of a meaningful one-line summary.</comment>

<file context>
@@ -19,7 +19,8 @@
 from utcp.data.utcp_client_config import UtcpClientConfig
 
 class DefaultVariableSubstitutor(VariableSubstitutor):
-    &quot;&quot;&quot;Default implementation of variable substitution.
+    &quot;&quot;&quot;REQUIRED
+    Default implementation of variable substitution.
 
</file context>


class ApiKeyAuth(Auth):
"""Authentication using an API key.
"""REQUIRED
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docstring starts with placeholder 'REQUIRED' instead of a one-line summary; violates standard docstring conventions and may impact doc generation.

Prompt for AI agents
Address the following comment on core/src/utcp/data/auth_implementations/api_key_auth.py at line 8:

<comment>Docstring starts with placeholder &#39;REQUIRED&#39; instead of a one-line summary; violates standard docstring conventions and may impact doc generation.</comment>

<file context>
@@ -5,7 +5,8 @@
 from utcp.exceptions import UtcpSerializerValidationError
 
 class ApiKeyAuth(Auth):
-    &quot;&quot;&quot;Authentication using an API key.
+    &quot;&quot;&quot;REQUIRED
+    Authentication using an API key.
 
</file context>


class OAuth2Auth(Auth):
"""Authentication using OAuth2 client credentials flow.
"""REQUIRED
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docstrings begin with a 'REQUIRED' placeholder instead of a meaningful summary; replace the placeholder with an appropriate summary to improve documentation clarity.

Prompt for AI agents
Address the following comment on core/src/utcp/data/auth_implementations/oauth2_auth.py at line 9:

<comment>Docstrings begin with a &#39;REQUIRED&#39; placeholder instead of a meaningful summary; replace the placeholder with an appropriate summary to improve documentation clarity.</comment>

<file context>
@@ -6,7 +6,8 @@
 
 
 class OAuth2Auth(Auth):
-    &quot;&quot;&quot;Authentication using OAuth2 client credentials flow.
+    &quot;&quot;&quot;REQUIRED
+    Authentication using OAuth2 client credentials flow.
 
</file context>


class VariableLoader(BaseModel, ABC):
"""Abstract base class for variable loading configurations.
"""REQUIRED
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docstrings start with the placeholder 'REQUIRED' instead of a clear one-line summary; replace the placeholder or move the summary to the first line to follow PEP 257 and maintain documentation quality.

Prompt for AI agents
Address the following comment on core/src/utcp/data/variable_loader.py at line 10:

<comment>Docstrings start with the placeholder &#39;REQUIRED&#39; instead of a clear one-line summary; replace the placeholder or move the summary to the first line to follow PEP 257 and maintain documentation quality.</comment>

<file context>
@@ -7,7 +7,8 @@
 import traceback
 
 class VariableLoader(BaseModel, ABC):
-    &quot;&quot;&quot;Abstract base class for variable loading configurations.
+    &quot;&quot;&quot;REQUIRED
+    Abstract base class for variable loading configurations.
 
</file context>


class HttpCallTemplate(CallTemplate):
"""Provider configuration for HTTP-based tools.
"""REQUIRED
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docstring should begin with the summary sentence; avoid using 'REQUIRED' as a standalone first line. Move the summary to the first line and format per docstring conventions.

Prompt for AI agents
Address the following comment on plugins/communication_protocols/http/src/utcp_http/http_call_template.py at line 10:

<comment>Docstring should begin with the summary sentence; avoid using &#39;REQUIRED&#39; as a standalone first line. Move the summary to the first line and format per docstring conventions.</comment>

<file context>
@@ -7,7 +7,8 @@
 from pydantic import Field
 
 class HttpCallTemplate(CallTemplate):
-    &quot;&quot;&quot;Provider configuration for HTTP-based tools.
+    &quot;&quot;&quot;REQUIRED
+    Provider configuration for HTTP-based tools.
 
</file context>


class CommunicationProtocol(ABC):
"""Abstract interface for UTCP client transport implementations.
"""REQUIRED
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docstrings start with 'REQUIRED' instead of a summary line, violating docstring conventions and reducing documentation quality.

Prompt for AI agents
Address the following comment on core/src/utcp/interfaces/communication_protocol.py at line 16:

<comment>Docstrings start with &#39;REQUIRED&#39; instead of a summary line, violating docstring conventions and reducing documentation quality.</comment>

<file context>
@@ -13,7 +13,8 @@
     from utcp.utcp_client import UtcpClient
 
 class CommunicationProtocol(ABC):
-    &quot;&quot;&quot;Abstract interface for UTCP client transport implementations.
+    &quot;&quot;&quot;REQUIRED
+    Abstract interface for UTCP client transport implementations.
 
</file context>


class SseCallTemplate(CallTemplate):
"""Provider configuration for Server-Sent Events (SSE) tools.
"""REQUIRED
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docstring should start with a concise summary; using 'REQUIRED' as the first line violates docstring conventions.

Prompt for AI agents
Address the following comment on plugins/communication_protocols/http/src/utcp_http/sse_call_template.py at line 10:

<comment>Docstring should start with a concise summary; using &#39;REQUIRED&#39; as the first line violates docstring conventions.</comment>

<file context>
@@ -7,7 +7,8 @@
 from pydantic import Field
 
 class SseCallTemplate(CallTemplate):
-    &quot;&quot;&quot;Provider configuration for Server-Sent Events (SSE) tools.
+    &quot;&quot;&quot;REQUIRED
+    Provider configuration for Server-Sent Events (SSE) tools.
 
</file context>

if self.is_required_docstring(method_docstring):
signature = self.get_function_signature(item)
if signature.__contains__('find_required_variables'):
print("test")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove stray debug print left from debugging.

Prompt for AI agents
Address the following comment on scripts/extract_required_docs.py at line 386:

<comment>Remove stray debug print left from debugging.</comment>

<file context>
@@ -0,0 +1,966 @@
+#!/usr/bin/env python3
+&quot;&quot;&quot;
+Script to extract REQUIRED docstrings from UTCP codebase and generate Docusaurus documentation.
+
+This script scans all Python files in core/ and plugins/ directories, extracts docstrings
+that start with &quot;REQUIRED&quot;, and generates organized Docusaurus markdown files.
+&quot;&quot;&quot;
+
+import ast
</file context>

return processed

if docstring.__contains__('{VAR}'):
print("")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove stray debug print that outputs a blank line during docstring processing.

Prompt for AI agents
Address the following comment on scripts/extract_required_docs.py at line 203:

<comment>Remove stray debug print that outputs a blank line during docstring processing.</comment>

<file context>
@@ -0,0 +1,966 @@
+#!/usr/bin/env python3
+&quot;&quot;&quot;
+Script to extract REQUIRED docstrings from UTCP codebase and generate Docusaurus documentation.
+
+This script scans all Python files in core/ and plugins/ directories, extracts docstrings
+that start with &quot;REQUIRED&quot;, and generates organized Docusaurus markdown files.
+&quot;&quot;&quot;
+
+import ast
</file context>

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.

3 participants