fix(docs): replace stale log_stream references in published docstrings - #214
Conversation
…amples (HYBIM-941) - agent_stream.py: all example blocks now use agent_stream.* calls - agent_streams.py: enable_evaluators example blocks updated - singleton.py: rename log_stream/log_stream_id param docs to agent_stream/agent_stream_id across get(), reset(), flush(); fix body prose "log_stream" → "agent_stream" in flush() description - decorator.py: rename log_stream/log_stream_id param docs to agent_stream/agent_stream_id in get(), flush(), and reset() methods Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- decorator.py: fix malformed agent_stream param (inline style + duplicate description → NumPy convention) - agent_stream.py: rename log_streams variable to agent_streams in list() docstring examples; update caption prose - agent_streams.py: rename log_streams variable and "Log Stream:" log message to agent_streams / "Agent Stream:" in class docstring Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
This PR supersedes #213, which was closed when the branch was renamed to decouple it from the incorrectly linked HYBIM-941 ticket (that ticket tracks a separate, currently-blocked URL placeholder rebrand with no overlap with this change). All three inline comments from #213 are addressed here:
|
fercor-cisco
left a comment
There was a problem hiding this comment.
🤖 This review was generated by the Astra agent (claude-opus-5). It may contain mistakes.
Verdict: request_changes — The agent_stream.py:82 rename produces a published example that calls a method which does not exist on that class, and several docstrings the PR edited were only partially updated.
General Comments
-
🟡 minor (documentation): Partial coverage within the docstrings this PR edited. The PR fixes one sentence in a docstring but leaves an adjacent stale sentence in the same docstring, so the published output will still be internally inconsistent:
-
decorator.py:1404— short description still says "a project and log stream" while line 1407-1408 in the same docstring was updated to "agent stream". -
decorator.py:1223— theReturnssection still says "specified project and log stream" while theParametersblock directly above it was renamed. -
singleton.py:21— the class docstring still says "the given 'project' and 'log_stream' parameters", the exact phrasing that was fixed inget()at line 168.
These are all published (scripts/create_docs.py emits class docstrings and all non-underscore methods), so the Codex re-review in the test plan will flag them again. They're cheap to include here.
- 🟡 minor (design): Scope question on the deferral. The description defers
shared/column.py,shared/query_result.py, andevaluator.pyto a follow-up, but those files contain the same class of defect this PR is fixing — undefinedlog_stream.*identifiers in published example blocks (e.g.column.py:65-70,query_result.py:66,evaluator.py:1245).project.py:61also has a stalelog_streams = project.list_agent_streams()identifier, which falls under the "identifiers" bucket this PR claims to cover.
Since the stated success criterion is "re-run Codex review on the new autogenerated PR and get a clean result", splitting mechanically-identical one-line fixes across two PRs means a second publish cycle before that criterion can be met. Is there a reason not to fold them in? If the split is deliberate to keep the diff reviewable, that's reasonable — but please open the follow-up issue before merge so it doesn't get dropped.
Follow-ups
Suggested follow-up work that could be tracked as Jira tickets:
src/splunk_ao/shared/column.py:65-70: Stalelog_stream.*identifiers in published example blocks (also lines 171, 174, 456, 476, 528, 531, 535, 539). Same defect class as this PR; acknowledged as out of scope. Note these are undefined names, so the examples are not copy-pasteable — and unlikeagent_stream.py:82, the receiver here is the object-centricAgentStream, so the correct rename target isagent_streamwithget_traces/trace_columns(which do exist on it).src/splunk_ao/shared/query_result.py:66-105: Stalelog_stream.get_spans(...)/log_stream.queryidentifiers in published docstrings (lines 66, 81, 105, 193, 199, 246, 273).src/splunk_ao/evaluator.py:1244-1245: Stale# Use with log streamcomment andlog_stream.set_metrics([local_metric])identifier in a published docstring.src/splunk_ao/project.py:57-61: Stalelog_streams = project.list_agent_streams()identifier and "# Create a log stream for the project" / "# List log streams for the project" comments in the publishedProjectclass docstring. This is an identifier rather than prose, so it arguably belongs in this PR's stated scope.src/splunk_ao/utils/singleton.py:180-180: Unrelated stale type name from a different rename: the docstring sayslocal_metrics (Optional[list[LocalScorerConfig]])but the signature at line 160 islist[LocalMetricConfig] | None.LocalScorerConfigno longer exists anywhere insrc/. The prose below it also still says "Local scorers".src/splunk_ao/decorator.py:1219-1219:get_logger_instanceaccepts aningestion_hookparameter (line 1201) that is undocumented in itsParametersblock. Same gap inSplunkAOLoggerSingleton.get, whose docstring omitsproject_id,agent_stream_id,mode,trace_id,span_id, andingestion_hook.
Co-authored-by: Fernando Correia <fercor@cisco.com>
Co-authored-by: Fernando Correia <fercor@cisco.com>
- singleton.py: class docstring "log_stream" parameter reference → "agent_stream" - decorator.py: Returns section "project and log stream" → "project and agent stream" - decorator.py: init_context short description "log stream" → "agent stream" Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Thanks for the detailed review, @fercor-cisco. Fixed in this PR (pushed in the follow-up commit From the three inline comments carried over from #213:
From this review's partial-coverage findings:
On the deferred files ( Acknowledged as follow-ups:
|
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
| from splunk_ao.schema.metrics import SplunkAOEvaluators | ||
| local_metrics = log_stream.enable_evaluators([ | ||
| # Enable metrics on the agent stream | ||
| from splunk_ao.schema.metrics import SplunkAOEvaluators |
There was a problem hiding this comment.
duplicate lines added by botched suggestion applies
| log_streams = AgentStreams() | ||
| agent_stream = log_streams.get(name="Production Logs", project_name="My AI Project") | ||
| # Get an agent stream first | ||
| agent_streams = AgentStreams() |
There was a problem hiding this comment.
same problem, botched suggestion applies
Summary
Fixes stale
log_stream.*variable references and param documentation in published docstrings — left over from theLogStream → AgentStreamrename. These are docstring-only changes; no runtime behaviour is affected.Source: Codex review findings from agent-observability-docs PR #41. The SDK's docstrings are auto-published via
.github/workflows/publish-docs.yaml/scripts/create_docs.py— the generated.mdxfiles in that repo must not be manually patched; the fix belongs here.Files changed
src/splunk_ao/agent_stream.pylog_stream.*→agent_stream.*src/splunk_ao/agent_streams.pyenable_evaluatorsexample blocks updatedsrc/splunk_ao/utils/singleton.pyget(),reset(),flush()src/splunk_ao/decorator.pyget(),flush(),reset()methodsNote: This PR covers the identifiers and param docs flagged in the initial Codex review. Remaining stale prose (
shared/column.py,shared/query_result.py,evaluator.py, and broader "log stream" prose throughout published docstrings) is out of scope here and will be addressed in a follow-up.Test plan
grep -r "log_stream\." src/splunk_ao/agent_stream.pyreturns onlyretrieved_log_stream.*/created_log_stream.*(internal API response variables, correct)agent-observability-docs🤖 Generated with Claude Code