Skip to content

Split harness-ops session hooks into session-telemetry and plugin-diagnostics #16437

Closed
3 of 3 issues completed
Closed

Description

@kyle-sexton

Parent

Refs #16428: Ship the plugin-profiles plugin and remove the core bundle (sibling effort; this item ships as its own pull request after the container's)

Depends on

Outcome

harness-ops' session-wide hooks split by responsibility into two hook-only plugins a user switches on or off as a whole: session-telemetry collects telemetry about each session, and plugin-diagnostics reports why installed plugins cannot run. guardrails takes the settings-write ask and the connected-page gate. The always-on profile swaps harness-ops and context-budget for the two units, and harness-ops moves to harness-upkeep.

Demo: with harness-ops off, a session still records skill use and hook runs, and a hook that fails to launch is still reported at the end of the turn.

Decisions

  • Q68 / D10: two hook units split by reason to change; the recorder changes with the hook-telemetry contract, the diagnostics unit with the prerequisites contract.
  • Q71 (owner): names session-telemetry ("Collects telemetry about each Claude Code session (hook runs, session events and skill use) from this plugin's hooks and from any plugin's hook-telemetry producers, for later analysis.") and plugin-diagnostics ("Detects and reports why installed plugins cannot run: hooks that fail to launch, and missing runtimes or prerequisite tools.").
  • Q72 (a): the prerequisites notices move into plugin-diagnostics with their own synced copy of the check code; running each plugin's declared probe through the prerequisites contract counts as using a contract.
  • Q73 (a): @harness-ops stays a valid sink value resolving through session-telemetry; a new value is added; every hook-utils.sh copy is resynced.
  • Q75 (b) (owner, 2026-11-15: "go w/ recomendations"): harness-ops does not declare session-telemetry as a dependency (plan D9 dropped), since a disabled dependency stops its dependent loading. Its readers check whether session-telemetry is enabled; when not, they say so with its install line and carry on.
  • D3 (owner): session-telemetry is not on by default; plugin-diagnostics is.
  • D12: skill-usage.jsonl gets a 10 MiB cap with one rotated copy.
  • Hook-unit rule (owner): a hook unit never depends on a skill, an agent or any file of another plugin.

Key interfaces

The hook-telemetry contract (sink values), the prerequisites contract, a new session-telemetry data-path contract (sink options and launcher) that harness-ops' observability, audit-skill-visibility and setup skills read with a fallback. Pre-flight: list every reader of the moved data and options, every @harness-ops resolver, the node-notice references, and CI lanes that load harness-ops.

Review criterion (owner): "Make sure we're applying solid principles: Single Responsibility Principle, DRY, Single Source of Truth principle, so no duplication. Make sure we're adhering to general good practice, best practice, and software engineering principles: low coupling, high cohesion; things that change together live together; feature vertical slice architecture."

Done when

  • AC24, AC25: always-on lists both units; the setup's hook-plugin question covers them.
  • Neither unit's hooks reference another plugin's files (grep of their hooks/ folders finds no other plugin path).
  • scripts/sync-shared-copies.sh --check exits 0.
  • guardrails' suite passes, including a headless settings-write ask returning a block with a reason.
  • plugin-diagnostics launches node only through node-or-skip on the prerequisites row.
  • Q75 (b): with session-telemetry off, harness-ops' observability, audit-skill-visibility and setup skills each say it is not enabled, print its install line, and carry on with what they can still do; plugins/harness-ops/.claude-plugin/plugin.json declares no dependency on it.
  • AC7 (process criterion of the effort): carried by the container's PR.

Out of scope

  • Renaming the published -audit telemetry hook ids (recorded in the ADR instead).

Sub-issues

Sub-issues

3 of 3 Issues completed
Loading 3 sub-issues

Activity

  1. added
    agent-ready
    on Nov 15, 2026
  2. self-assigned this
    on Nov 15, 2026
  3. added
    needs-triage
    on Nov 15, 2026
  4. github-actions commented on Nov 15, 2026

    @github-actions
    Contributor

    Size: Large
    Complexity: Medium
    Uncertainty: Knowable
    Flags: none
    Blocked by: #16429

    I read this as a request to split harness-ops' session-wide hooks into two hook-only plugins: session-telemetry (collects telemetry about each session) and plugin-diagnostics (reports why installed plugins cannot run). guardrails takes the settings-write ask and the connected-page gate. The always-on profile swaps harness-ops and context-budget for the two new plugins, and harness-ops moves to harness-upkeep.

    The outcome and done-when list are exact, so I'm not asking the owner anything.

    The work depends on #16429, which is still open, so I listed it as blocking. It also needs the pre-flight inventory the issue names: every reader of the moved data and options, every @​harness-ops resolver, the node-notice references, and CI lanes that load harness-ops. The work is large enough that it may need splitting into several pull requests.

    I found no duplicate among the open issues and no merged pull request that already covers this. It is a sibling of #16428.

    Automated triage. A maintainer reviews it.

  5. removed
    needs-triage
    on Nov 15, 2026
  6. melodic-automation-lanes commented on Nov 15, 2026

    @melodic-automation-lanes
    Contributor

    Not admitted to the issue lane yet: Size large: the split into sub-issues at intake is pending (owner Q93).

  7. melodic-automation-lanes commented on Nov 15, 2026

    @melodic-automation-lanes
    Contributor

    Split at intake (owner Q93). This issue is Size Large, so its done-when is split into 3 sub-issues, each holding its task-list lines as written.

    Automated split by the lanes App. Admission waits on this issue while a sub-issue is open; work-unblock closes it as completed once every sub-issue is closed as completed by a merge or a listed human and its done-when is covered.

  8. added
    host-run
    on Nov 16, 2026
  9. kyle-sexton commented on Nov 16, 2026

    @kyle-sexton
    MemberAuthor

    The three parts filed by the intake size-split (#16438, #16439, #16441) are built host-run, as one pull request under this issue, by the background session plugin-profiles-build-3 (branch feat/hook-units). That follows the owner's decision of three pull requests in this repository for the plugin-profiles work, and this issue's own host-run label.

    The split left no part with the work of creating session-telemetry and plugin-diagnostics: each part only checks properties of those units, which is why the issue lane stopped on #16439 as an intent change. The parts did not inherit host-run, so the lane took #16438 once #16429 closed.

    Done by the control-hub session "Plugin Presets" on 2026-11-16:

    The hook-unit pull request will close the three parts with this issue when it delivers their done-when items. Please do not re-split or re-admit them.

  10. kyle-sexton commented on Nov 16, 2026

    @kyle-sexton
    MemberAuthor

    Decision recorded. Owner, 2026-11-16: "go w/ recomendations". The recommendation was to close #16517, #16438 and #16437 on guardrails' unit suites plus the #16438 headless transcript, with the criterion "a headless settings-write ask returning a block with a reason" reworded to "the guard fires with its reason and the write is blocked".

    • Both guards run from guardrails: feat(guardrails)!: move the settings-write ask and connected-page gate into guardrails #16543 merged as dceb40c8b5d6e6704850c0416adf28e16f249563. plugins/guardrails/hooks/ on main holds settings-write-ask.mjs and connected-page-gate.mjs with their test files, and no check run failed at the merged head 859539c87a294bbd6b4eb48e94a60c4924f3ecfd.
    • always-on.yaml no longer lists context-budget; harness-upkeep.yaml lists it.
    • The headless run (Claude Code 2.1.325, default mode, guardrails loaded from 859539c8, session ed867279-4407-4ac6-8858-edbf3cc29564): a write to a .claude/settings.json was tried; the hook returned ask with its reason; Claude Code's own settings-file check then rejected the write with its own text; the file was not written. The transcript is kept on the owner's machine.
    • What the run did not show: the hook's ask reaching a person as a prompt, since Claude Code's own check rejected the write first. That is why the criterion was reworded. The guard's probe note is updated to say what this run measured in a follow-up pull request.

    The hook-unit split itself (session-telemetry and plugin-diagnostics) shipped in #16519, merged as 24e622cf.

  11. removed
    host-run
    on Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

agent-ready

Fields

Work status

ready

Priority

medium

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions