Skip to content

chore: repair Sphinx parser issues in eventing docstrings#1398

Open
jaelliot wants to merge 3 commits intoWebOfTrust:mainfrom
jaelliot:chore/docstrings-eventing-only
Open

chore: repair Sphinx parser issues in eventing docstrings#1398
jaelliot wants to merge 3 commits intoWebOfTrust:mainfrom
jaelliot:chore/docstrings-eventing-only

Conversation

@jaelliot
Copy link
Copy Markdown
Contributor

Summary

Repair Sphinx/docutils parser issues in src/keri/core/eventing.py with a narrow, docstring-focused pass.

What changed

  • repaired parser-confusing docstring section formatting in eventing.py
  • adjusted example and prose block formatting where docutils was treating content as malformed lists or blocks
  • kept the change surface confined to the existing eventing docstring cleanup lane

Notes

  • branch pushed from jaelliot/chore/docstrings-eventing-only
  • local verification was bypassed for publish at requester direction
  • residual warnings may still remain in eventing.py and can be handled in follow-up if needed

Copilot AI review requested due to automatic review settings April 14, 2026 22:33
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR aims to eliminate Sphinx/docutils parsing warnings in eventing.py by normalizing docstring reStructuredText (reST) formatting, especially around section headers and embedded examples.

Changes:

  • Adjusted docstring section markers (e.g., Parameters::, Returns::) and spacing to avoid malformed list/literal-block parsing.
  • Reformatted several embedded message examples into explicit literal blocks.
  • Minor cleanup to logging statements and exception handlers while staying within the “docstrings-only” lane.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/keri/core/eventing.py
Comment on lines +29 to 30
from .coring import (PreDex, DigDex, NonTransDex, NumDex, Number, Seqner, Cigar, Dater, Noncer,
Verfer, Diger, Prefixer, Tholder)
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

This import was collapsed into a very long line, which makes it harder to scan and is more likely to violate typical line-length tooling. Consider re-wrapping this back into a more standard multi-line parenthesized import (one name per line or smaller groups) to improve readability and reduce future merge conflicts.

Copilot uses AI. Check for mistakes.
Comment thread src/keri/core/eventing.py Outdated
Comment on lines +1820 to +1821
:no-index:

Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

:no-index: is not a recognized Sphinx option in this context (and the option name is typically :noindex: without a dash). If the goal is to suppress indexing for this member, it generally needs to be configured on the autodoc directive/options in the .rst (or via autodoc_default_options), not embedded as a standalone line in the docstring.

Suggested change
:no-index:

Copilot uses AI. Check for mistakes.
Comment thread src/keri/core/eventing.py
Comment on lines +1058 to +1063
{
"v" : "KERI10JSON00011c_",
"t" : "qry",
"d": "EZ-i0d8JZAoTNZH3ULaU6JR2nmwyvYAfSVPzhzS6b5CM",
"i": "EaU6JR2nmwyZ-i0d8JZAoTNZH3ULvYAfSVPzhzS6b5CM"
"dt": "2020-08-22T17:50:12.988921+00:00",
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

The Version 2.0 example is not valid JSON as written because it’s missing a comma after the \"i\" field (line 1062). Since these examples look copy/paste oriented, it would be better to make them valid JSON (add the comma, and also consider removing trailing commas elsewhere) or explicitly label them as pseudo-JSON.

Copilot uses AI. Check for mistakes.
Comment thread src/keri/core/eventing.py
Comment on lines +1141 to +1145
"d": "EaU6JR2nmwyZ-i0d8JZAoTNZH3ULvYAfSVPzhzS6b5CM",
"i": "EAoTNZH3ULvYAfSVPzhzS6baU6JR2nmwyZ-i0d8JZ5CM",
"name": "John Jones",
"role": "Founder",
}
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

This embedded message example includes a trailing comma after the last field (\"role\": \"Founder\",), which makes the example invalid JSON. Several other examples in this diff still contain trailing commas; consider removing trailing commas throughout so the examples are syntactically valid and easier to copy/paste.

Copilot uses AI. Check for mistakes.
Comment thread src/keri/core/eventing.py
Comment on lines 115 to 116
def deWitnessCouple(data, strip=False):
"""
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

The docstring parameter name deletive does not match the function signature (strip). This looks like a documentation bug (and may confuse users reading generated docs). Rename deletive to strip in the docstring (and keep the semantics consistent with what the function actually does).

Copilot uses AI. Check for mistakes.
Comment thread src/keri/core/eventing.py
Parameters::

data is couple of bytes concatenation of dig+wig from receipt
deletive is Boolean True means delete from data each part as parsed
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

The docstring parameter name deletive does not match the function signature (strip). This looks like a documentation bug (and may confuse users reading generated docs). Rename deletive to strip in the docstring (and keep the semantics consistent with what the function actually does).

Suggested change
deletive is Boolean True means delete from data each part as parsed
strip is Boolean True means delete from data each part as parsed

Copilot uses AI. Check for mistakes.
Comment thread src/keri/core/eventing.py
Comment on lines 183 to +186
def deSourceCouple(data, strip=False):
"""
Returns tuple of (number, diger) from concatenated bytes or bytearray
of data couple made up of qb64 or qb64b versions of snu+dig where:
of data couple made up of qb64 or qb64b versions of snu+dig where::
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

In deSourceCouple, the parameter description says the input is pre+sig, but the docstring above describes the couple as snu+dig and the return type is (number, diger). Update the parameter prose to match the documented encoding (snu+dig) so the docstring is internally consistent.

Copilot uses AI. Check for mistakes.
Comment thread src/keri/core/eventing.py
Parameters:
Parameters::

data is couple of bytes concatenation of pre+sig from receipt
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

In deSourceCouple, the parameter description says the input is pre+sig, but the docstring above describes the couple as snu+dig and the return type is (number, diger). Update the parameter prose to match the documented encoding (snu+dig) so the docstring is internally consistent.

Suggested change
data is couple of bytes concatenation of pre+sig from receipt
data is couple of bytes concatenation of snu+dig from source event

Copilot uses AI. Check for mistakes.
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