feat(connectors): add agent docs, per-batch observability, atomic state - #3321
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #3321 +/- ##
=============================================
- Coverage 74.21% 54.95% -19.26%
Complexity 943 943
=============================================
Files 1239 1240 +1
Lines 112620 102069 -10551
Branches 89106 78584 -10522
=============================================
- Hits 83577 56093 -27484
- Misses 26257 43334 +17077
+ Partials 2786 2642 -144
🚀 New features to boost your workflow:
|
hubcio
left a comment
There was a problem hiding this comment.
a few non-blocking items that fall outside the changed hunks, recorded here so they don't get lost:
core/connectors/runtime/src/configs/runtime.rs::Display for ConnectorsRuntimeConfig(around thewrite!near line 366) was not updated whenlogging: LoggingConfigwas added at line 145 - operators dumping the config won't see the new format setting.core/connectors/runtime/src/configs/connectors.rs::Display for SinkConfig/SourceConfig(around line 313 / 332) similarly omits the newverboseandbenchmarkfields.core/connectors/runtime/src/sink.rs:42-44imports onlyInstant, butDurationis reached via fully-qualified path at line 552. fold intouse std::time::{Duration, Instant};.core/connectors/runtime/example_config/config.tomlhas no[logging]section and none ofexample_config/connectors/*.tomlshowsbenchmark = true. operators learn the new knobs only from source. add one example each.- the state save now does +1 dir-fsync per save vs the previous in-place code. pre-PR was 1
sync_all, post-PR is 1sync_data+ 1 parent-dirsync_all. on NVMe that's ~50-200 us extra per save - worth a one-liner in the PR body / CHANGELOG so operators don't blame the upgrade for state-save latency.
on a separate axis - there's a compound shutdown / restart bug between manager/source.rs::stop_connector and the silent-return added to source.rs::handle_produced_messages. the inline comment on source.rs covers it.
hubcio
left a comment
There was a problem hiding this comment.
this part is more focused on markdowns review that you're adding in this PR. will be a long one, so brace yourself 🦀
-
CLAUDE.md / AGENTS.md direction is best left as discussion. AGENTS.md is the converging cross-tool standard (codex, cursor, aider, windsurf all read it); inverting would optimize for one ecosystem at the cost of cross-tool discoverability. cheap middle ground: add a
CLAUDE.mdsymlink pointing toAGENTS.mdso tools that hardcode the claude filename find the same content. zero churn. -
STOP-and-ask sections per skill: each SKILL.md has scattered "don't do X" / "gotchas" / "hard rules", but no consolidated 3-5 bullet list of triggers that should always surface to the user before action (e.g. bumping SDK version, changing FFI signature, renaming the default consumer group, touching
state.rssave path, changing wire-format#[repr(C)]layout). a tight top-of-file STOP section would be high signal for autonomous agents. -
community pointer from skills (optional): AGENTS.md lists discord + github discussions in the support section at the bottom; individual skills don't. a one-liner at the end of each SKILL.md pointing at AGENTS.md instead of duplicating urls would be enough.
-
universal-rule duplication: beyond AGENTS.md vs skills, per-area skills also restate rules (license header, verification order
fmt->sort->clippy->test,tokio::sync::Mutex, zero-clone, forward-compat config). pick one owner per topic - repo-wide in AGENTS.md, connector-wide inconnectors-overview, per-area skills link not restate. follow-up. -
cross-skill content duplication: benchmark + metrics block in
connector-runtime(lines 75-114, 213-230) approximately equalsconnectors-overview(lines 165-196).SecretStringpattern in sink (240-267), source (228-246), overview (155-163).verboseflag re-explained in 4 places. canonicalize and link. follow-up. -
no TOC in long files: all 7 SKILL.md plus AGENTS.md are >100 lines (largest: connector-sink 370, AGENTS.md 355, connector-source 346, connector-testing 336). short TOC at top helps partial-read previews show scope.
-
no CI / pre-commit governance for
.claude/skills/: this PR introduces the first AI-agent tree in the repo. nothing references.claude/in.gitignore,.pre-commit-config.yaml, or.github/workflows/. follow-up worth scoping: validate YAML frontmatter on everySKILL.md(non-emptyname:kebab-case <=64 chars, non-emptydescription:<=1024 chars), resolve markdown links inside.claude/skills/**/*.md, optionally grep-check thatpath::symbolreferences in skill files resolve to identifiers undercore/. this catches both frontmatter drift and rename drift in one pass.
all above are follow-ups, not blockers.
BTW: in order to prepare this analysis, i used these resources:
- https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices — Anthropic skill authoring
best practices - https://code.claude.com/docs/en/skills — Claude Code Docs: Extend Claude with skills
- https://claude.com/blog/how-claude-code-works-in-large-codebases-best-practices-and-where-to-start — Anthropic
blog: large codebases - https://www.groff.dev/blog/implementing-claude-md-agent-skills — Groff: implementing CLAUDE.md + agent skills
- https://alexop.dev/posts/claude-code-customization-guide-claudemd-skills-subagents/ — alexop.dev:
customization guide - https://www.anthropic.com/engineering/equipping-agents-for-the-real-world-with-agent-skills — Anthropic
engineering: equipping agents - https://github.com/anthropics/skills — anthropics/skills reference repo
|
/ready |
|
/ready |
Connector work lacked a concise agent-facing reference, and
runtime behavior around drops, shutdown, and state writes was
hard to reason about or debug. Per-batch latency visibility
was missing, some failure paths were under-accounted, hot
paths still paid avoidable metric lookup costs, and source
state persistence was not crash-atomic.
Add a repo-level AGENTS entry point plus
.claudeconnectorskills anchored to concrete symbols so authoring rules survive
refactors. Extend the runtime with opt-in benchmark events,
always-on stage histograms, aligned sink/source stage labels,
JSON or text log selection, cached metric labels and counters
on hot paths, explicit filtered-message accounting, safer
source shutdown, and crash-atomic state saves with durable
parent-directory sync.
This keeps observability available without forcing benchmark
logs by default, improves failure-path correctness, and gives
future connector work one documented model to follow.