Private
Public Access
docs(ai_client): rename send_result to send in 3 current docs
Doc consistency: guide_ai_client.md, guide_app_controller.md, and
the error_handling styleguide now reference the new symbol name.
Also fixes two consistency issues in error_handling.md introduced by
the mechanical rename:
1. The 'Deprecation: send -> send_result' section (lines 623-642) was
rewritten as a 'Historical deprecation (added 2026-06-15, reverted
2026-06-16)' note that points to the relevant track specs.
2. Line 204 (the 'Current State Audit' summary for src/ai_client.py)
had a self-contradictory claim ('send() is the new public API;
send() is @deprecated') after the rename. Updated to describe
the canonical public API.
Historical archives (conductor/tracks/*/spec.md, conductor/tracks/*/plan.md,
docs/reports/*) are NOT modified - they document the 2026-06-15
public_api_migration decision and stay as historical record.
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
"""Apply Phase 5 mechanical rename to the 3 current docs."""
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
FILES = [
|
||||
"docs/guide_ai_client.md",
|
||||
"docs/guide_app_controller.md",
|
||||
"conductor/code_styleguides/error_handling.md",
|
||||
]
|
||||
|
||||
|
||||
def main() -> int:
|
||||
total = 0
|
||||
for rel in FILES:
|
||||
p = Path(rel)
|
||||
with p.open("r", encoding="utf-8", newline="") as f:
|
||||
content = f.read()
|
||||
before = content.count("send_result")
|
||||
new_content = content.replace("send_result", "send")
|
||||
with p.open("w", encoding="utf-8", newline="") as f:
|
||||
f.write(new_content)
|
||||
remaining = new_content.count("send_result")
|
||||
print(f"{rel}: {before} -> {before - remaining} (remaining={remaining})")
|
||||
total += before - remaining
|
||||
print(f"Total: {total} renamed")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
@@ -0,0 +1,58 @@
|
||||
"""Fix the deprecation section in error_handling.md to reflect historical state.
|
||||
|
||||
This uses a marker-based replacement to avoid encoding issues with unicode
|
||||
characters in PowerShell output.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
DOC = Path("conductor/code_styleguides/error_handling.md")
|
||||
|
||||
# We use the start and end markers that are unique to the deprecation section.
|
||||
START_MARKER = "## Deprecation: `ai_client."
|
||||
END_MARKER = "transition; new tests for the new API should\nassert the warning is NOT emitted by `send()`.\n\n"
|
||||
|
||||
|
||||
def main() -> int:
|
||||
with DOC.open("r", encoding="utf-8", newline="") as f:
|
||||
content = f.read()
|
||||
has_crlf = "\r\n" in content
|
||||
nl = "\r\n" if has_crlf else "\n"
|
||||
start_marker = START_MARKER.replace("\n", nl)
|
||||
end_marker = END_MARKER.replace("\n", nl)
|
||||
i = content.find(start_marker)
|
||||
if i < 0:
|
||||
print(f"Start marker not found", file=sys.stderr)
|
||||
return 1
|
||||
j = content.find(end_marker, i)
|
||||
if j < 0:
|
||||
print(f"End marker not found", file=sys.stderr)
|
||||
return 1
|
||||
end_of_section = j + len(end_marker)
|
||||
section_text = content[i:end_of_section]
|
||||
replacement = """## Historical deprecation (added 2026-06-15, reverted 2026-06-16)
|
||||
|
||||
The public `ai_client.send()` was briefly marked `@deprecated` in favor of
|
||||
`ai_client.send_result()` on 2026-06-15 by the
|
||||
`public_api_migration_and_ui_polish_20260615` track. The decision was
|
||||
reverted on 2026-06-16 by `send_result_to_send_20260616` after the
|
||||
Tier 2 autonomous sandbox proved capable of doing the rename safely.
|
||||
|
||||
`ai_client.send(...) -> Result[str, ErrorInfo]` is the canonical public API.
|
||||
No deprecation is in effect. For the historical record of the brief
|
||||
deprecation cycle, see
|
||||
`conductor/tracks/public_api_migration_and_ui_polish_20260615/spec.md`
|
||||
and `conductor/tracks/send_result_to_send_20260616/spec.md`.
|
||||
|
||||
""".replace("\n", nl)
|
||||
new_content = content[:i] + replacement + content[end_of_section:]
|
||||
with DOC.open("w", encoding="utf-8", newline="") as f:
|
||||
f.write(new_content)
|
||||
print(f"Replaced {len(section_text)} chars of deprecation section with {len(replacement)} chars of historical note.")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
@@ -0,0 +1,28 @@
|
||||
"""Fix the contradictory line 204 in error_handling.md."""
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
DOC = Path("conductor/code_styleguides/error_handling.md")
|
||||
|
||||
OLD = " grok); `send()` is the new public API; `send()` is `@deprecated`."
|
||||
|
||||
NEW = " grok); `send(...) -> Result[str, ErrorInfo]` is the public API."
|
||||
|
||||
|
||||
def main() -> int:
|
||||
with DOC.open("r", encoding="utf-8", newline="") as f:
|
||||
content = f.read()
|
||||
if OLD not in content:
|
||||
print(f"NOT FOUND: {OLD!r}", file=sys.stderr)
|
||||
return 1
|
||||
new_content = content.replace(OLD, NEW, 1)
|
||||
with DOC.open("w", encoding="utf-8", newline="") as f:
|
||||
f.write(new_content)
|
||||
print("Line 204 fixed.")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
Reference in New Issue
Block a user