Skip to content

feat(claude): resolve nested teammate reachability and document harness team coordinator - #355

Merged
gcko merged 1 commit into
mainfrom
feature/drc-4347-nested-teammate-reachability
Sep 16, 2026
Merged

gcko merged 1 commit into
mainfrom
feature/drc-4347-nested-teammate-reachability

Conversation

@gcko

@gcko gcko commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Implements DRC-4347.

Summary of Changes

  1. Root Session Prefix Resolution:

    • Claude Code teammates write teamName: session-<lead-prefix> to transcript records and inherit this across all teammates dispatched within an agent team.
    • If teammate records ever carry an intermediate child's session prefix (nested dispatch or synthetic test structure), collect_claude_sessions now recursively traces parent prefixes up to the root lead session prefix present in transcripts.
    • Nested teammate buckets are thus preserved and aggregated under the lead session instead of being dropped.
  2. Parent Attribution:

    • Nested teammate agents record their immediate parent's teammate name in parent.
    • published_agent() in collect_claude_sessions receives and publishes parent, allowing grandchild agents to be attributed correctly beneath their immediate dispatcher.
  3. Empirical Capture & Rationale:

    • Captured harness behavior in docs/captures/claude/nested-teammate-2.1.273-macos.jsonl verifying that Claude Code 2.1.273 dispatches teammates with --team-name session-<lead-prefix>, naturally bucketing all teammates under the lead coordinator.
    • Updated docs/captures/README.md with capture entry.
  4. Unit Tests:

    • Added test_nested_teammate_with_child_parent_prefix_is_published_under_lead in cargento/skills/cargento/tests/test_claude.py.
    • Added test_teammates_sharing_harness_lead_team_name_are_published_under_lead in cargento/skills/cargento/tests/test_claude.py.

Verification

  • ruff check .: clean
  • ruff format --check .: clean
  • mypy: clean (161 source files)
  • python3 scripts/lint_embedded.py: clean
  • python3 scripts/validate_plugins.py: clean
  • python3 scripts/bump_version.py --current: clean (version 0.25.0 unchanged)
  • claude plugin validate ./cargento --strict: valid
  • agy plugin validate ./cargento: valid
  • coverage run -m unittest discover -s cargento/skills/cargento/tests -t .: 100% pass (3,478 tests)
  • Full script test suite: 100% pass (14 script tests)
  • coverage report: 86.8% total coverage (above fail_under threshold)

…ss team coordinator

Signed-off-by: Jared Scott <jared.scott@variable.team>
@github-actions

Copy link
Copy Markdown
Contributor

Coverage

Name                                                                  Stmts   Miss Branch BrPart  Cover
-------------------------------------------------------------------------------------------------------
cargento/skills/cargento/agy_hook.py                                     79     14     28      7  78.5%
cargento/skills/cargento/cargento_runtime/__init__.py                     0      0      0      0 100.0%
cargento/skills/cargento/cargento_runtime/aggregate.py                  316      3    108      3  98.6%
cargento/skills/cargento/cargento_runtime/annotations.py                373     19    130     21  92.0%
cargento/skills/cargento/cargento_runtime/asks.py                       110      0     28      0 100.0%
cargento/skills/cargento/cargento_runtime/claude_data.py                340     40    158     18  88.4%
cargento/skills/cargento/cargento_runtime/cli.py                        208     20     52      6  89.2%
cargento/skills/cargento/cargento_runtime/collectors/__init__.py          0      0      0      0 100.0%
cargento/skills/cargento/cargento_runtime/collectors/antigravity.py     423     41    174     25  87.3%
cargento/skills/cargento/cargento_runtime/collectors/claude.py          305     17    112     15  91.8%
cargento/skills/cargento/cargento_runtime/collectors/codex.py           258     18     96     15  90.7%
cargento/skills/cargento/cargento_runtime/collectors/copilot.py         153      4     52      2  97.1%
cargento/skills/cargento/cargento_runtime/collectors/cursor.py          287     19    108     16  90.6%
cargento/skills/cargento/cargento_runtime/collectors/droid.py            34      3      6      1  90.0%
cargento/skills/cargento/cargento_runtime/collectors/gemini.py           54      7     16      4  84.3%
cargento/skills/cargento/cargento_runtime/collectors/goose.py            95      6     28      4  91.9%
cargento/skills/cargento/cargento_runtime/collectors/opencode.py        124      4     44      4  95.2%
cargento/skills/cargento/cargento_runtime/collectors/pi.py              328     34    152     20  88.8%
cargento/skills/cargento/cargento_runtime/config.py                     227      1     20      1  99.2%
cargento/skills/cargento/cargento_runtime/deliveries.py                 128     12     30      7  88.0%
cargento/skills/cargento/cargento_runtime/departures.py                 131      6     30      6  92.5%
cargento/skills/cargento/cargento_runtime/diagnostics.py                 88      3     26      3  94.7%
cargento/skills/cargento/cargento_runtime/dismissals.py                 105      2     28      2  97.0%
cargento/skills/cargento/cargento_runtime/ends.py                        89      5     18      0  95.3%
cargento/skills/cargento/cargento_runtime/events.py                     230      1     86      3  98.7%
cargento/skills/cargento/cargento_runtime/focus.py                       72      2     20      2  95.7%
cargento/skills/cargento/cargento_runtime/git_status.py                  59      1     22      2  96.3%
cargento/skills/cargento/cargento_runtime/history.py                    206      9     56      7  93.9%
cargento/skills/cargento/cargento_runtime/http_api.py                   933    107    300     37  88.3%
cargento/skills/cargento/cargento_runtime/interaction_prototype.py      709    219    198     38  65.9%
cargento/skills/cargento/cargento_runtime/io.py                         163      2     38      1  98.5%
cargento/skills/cargento/cargento_runtime/irreversible.py                39      0      6      0 100.0%
cargento/skills/cargento/cargento_runtime/lifecycle.py                  414     47    148     14  87.7%
cargento/skills/cargento/cargento_runtime/notifications.py              213      5     72      6  96.1%
cargento/skills/cargento/cargento_runtime/observation.py                412      6    122      3  98.3%
cargento/skills/cargento/cargento_runtime/observer.py                   388     24    156     15  92.8%
cargento/skills/cargento/cargento_runtime/probe.py                       44      0     18      1  98.4%
cargento/skills/cargento/cargento_runtime/project_context.py           1588    179    686    121  85.3%
cargento/skills/cargento/cargento_runtime/quota.py                      392      7    144      6  97.2%
cargento/skills/cargento/cargento_runtime/reading.py                    365      7    122      6  97.3%
cargento/skills/cargento/cargento_runtime/records.py                    265      5    118      9  96.3%
cargento/skills/cargento/cargento_runtime/semantic_history.py           290     14    110     18  92.0%
cargento/skills/cargento/cargento_runtime/sessions.py                   189      4     72      4  96.9%
cargento/skills/cargento/cargento_runtime/snapshot.py                    36      0      4      0 100.0%
cargento/skills/cargento/cargento_runtime/spacedock.py                  510     50    260     26  89.9%
cargento/skills/cargento/cargento_runtime/state.py                       80      0      2      0 100.0%
cargento/skills/cargento/cargento_runtime/stream.py                      57      0      8      0 100.0%
cargento/skills/cargento/cargento_runtime/transcripts.py                529     29    272     25  93.3%
cargento/skills/cargento/cargento_runtime/tripwires.py                  232     14     94     13  91.7%
cargento/skills/cargento/cargento_runtime/turns.py                      209     11    104     12  92.7%
cargento/skills/cargento/cargento_runtime/unasked.py                    117      2     32      1  98.0%
cargento/skills/cargento/cargento_runtime/web/__init__.py                 0      0      0      0 100.0%
cargento/skills/cargento/cargento_runtime/web/page.py                    38      0     10      0 100.0%
cargento/skills/cargento/event_hook.py                                  213     54     92     14  68.5%
cargento/skills/cargento/mcp_server.py                                  377     22    112     14  92.2%
cargento/skills/cargento/notify_hook.py                                  49     15      6      1  67.3%
cargento/skills/cargento/server.py                                        3      0      2      1  80.0%
cargento/skills/cargento/statusline_hook.py                             131     13     46      8  87.0%
scripts/bench_collect.py                                                211     10     54      6  94.0%
scripts/bench_event_latency.py                                           67     21     14      1  67.9%
scripts/bump_version.py                                                  60     12     24      5  77.4%
scripts/capture_focus_raise.py                                          729    131    236     16  79.4%
scripts/capture_hook.py                                                 292     30     90     11  88.7%
scripts/capture_team_registry.py                                        172     33     48      6  80.5%
scripts/capture_terminal_identity.py                                    347    108    104     14  66.3%
scripts/derive_prompt_shapes.py                                         210     16     88     14  89.3%
scripts/lint_embedded.py                                                 97      3     32      3  95.3%
scripts/mark_abstention.py                                              382    142    140     23  58.4%
scripts/score_abstention.py                                             493     52    182     18  88.4%
scripts/serve_operator_cockpit.py                                       448    191    112     20  54.5%
scripts/validate_plugins.py                                             762    202    434     67  70.8%
-------------------------------------------------------------------------------------------------------
TOTAL                                                                 18077   2078   6540    792  86.6%

Threshold: fail_under in pyproject.toml · label coverage-exception to bypass (visible in PR timeline).

gcko added a commit that referenced this pull request Sep 16, 2026
Signed-off-by: Jared Scott <jared.scott@variable.team>
@gcko
gcko merged commit 8a806c6 into main Sep 16, 2026
12 checks passed
@gcko
gcko deleted the feature/drc-4347-nested-teammate-reachability branch September 16, 2026 00:42
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