Skip to content

Add tgc agent entrypoint with command registry and next-actions triage#10

Open
speech115 wants to merge 3 commits into
mainfrom
pr/tgc-agent-entrypoint
Open

Add tgc agent entrypoint with command registry and next-actions triage#10
speech115 wants to merge 3 commits into
mainfrom
pr/tgc-agent-entrypoint

Conversation

@speech115

Copy link
Copy Markdown
Owner

What

Agent-ergonomics upgrade for the control plane: one entrypoint instead of doc archaeology across 28 wrappers.

  • tgc next --json — runs the core doctor and returns prioritized actions with exact drill-down commands; blocking findings come first and automatically append the dry-run telegram-repair-plan step.
  • tgc commands --json — machine-readable registry of every public command (purpose, level: daily/live/mirror/drilldown/maintenance/release, safety class, example).
  • command_registry.py — single source of truth; unit tests fail closed when a bin/ wrapper and the registry drift apart, or when AGENTS.md stops documenting a daily/live command.
  • AGENTS.md compressed to an intent→command table; deep prose moved to docs/agents/{doctor-triage,mcp-surface,telemetry,doc-sync}.md.
  • telegram-release-gate (runs gates) vs telegram-release-gates (audits config) naming documented.

Also lands the pending control-plane work from the local branch: doctor core/maintenance profiles, telegram-mirror-fast status/read/search, and source-evidence routing refinements.

Verification

  • python -m pytest -q -m 'not integration': 131 passed.
  • Local telegram-release-gate: exit 0.
  • Portable-mode pytest in this tree shows the same 4 pre-existing test_control_plane.py failures as clean main under the same local simulation — no new failures introduced.
  • Privacy scan over the diff: no new private paths, tokens, or host identifiers.

🤖 Generated with Claude Code

speech115 and others added 3 commits June 12, 2026 19:03
… source evidence

Pre-existing Codex WIP on this branch, committed as found (tests green):
doctor profiles (core vs maintenance), telegram-mirror-fast status/read/search,
source evidence/routing refinements, telecrawl gap policy updates, and the
matching docs/tests.
- command_registry.py: single source of truth for all bin/ commands
  (purpose, level, safety, example); unit-tested against bin/ and AGENTS.md
- tgc next: doctor findings mapped to prioritized executable drill-down
  commands, repair-plan step appended on blocking findings
- tgc commands: human table / --json registry dump
- AGENTS.md compressed to intent->command table; deep prose moved to
  docs/agents/{doctor-triage,mcp-surface,telemetry,doc-sync}.md
- release-gate (run) vs release-gates (audit) naming documented

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
mirror_fast.py imports yaml; CI installs only pytest, so test collection
failed with ModuleNotFoundError on ubuntu runners.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6aa829818f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

from pathlib import Path
from typing import Any

import yaml

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Declare PyYAML or avoid importing it

In a fresh install of this control-plane package, telegram-mirror-fast now fails at import time with ModuleNotFoundError: No module named 'yaml' because control-plane/pyproject.toml does not declare any runtime dependencies. This blocks the new wrapper and also prevents the test module from being collected unless PyYAML happens to be installed globally; either add the dependency to the package metadata or parse the simple channel config without an undeclared library.

Useful? React with 👍 / 👎.

if start and end and start > end:
raise ValueError("--date-from must be before or equal to --date-to")

messages: deque[dict[str, Any]] = deque(maxlen=max(limit, 0) or None)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Apply read limits after sorting all matches

When read matches more than one configured target, this deque applies --limit while iterating config/file order and only sorts afterward, so older rows from a later-matched export can evict newer rows from an earlier export before the date ordering is computed. Since _matches is substring-based and the response reports matched_targets, broad queries can silently omit the most relevant messages; collect matching rows first, sort by date/id, then slice to the requested limit.

Useful? React with 👍 / 👎.

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.

1 participant