Skip to content

feat(session-telemetry)!: split harness-ops session hooks into session-telemetry and plugin-diagnostics - #16519

Merged
kyle-sexton merged 19 commits into
mainfrom
feat/hook-units
Nov 16, 2026
Merged

kyle-sexton merged 19 commits into
mainfrom
feat/hook-units

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Closes #16439
Refs: #16441
Refs: #16437
Refs: #16438

Summary

harness-ops' session-wide hooks move into two hook-only plugins that a user switches on or off as a whole:

  • session-telemetry collects telemetry about each session. It is off by default (defaultEnabled: false).
  • plugin-diagnostics reports why installed plugins cannot run. It is on by default.

The always-on profile lists both units in place of harness-ops, which moves to harness-upkeep.

The two guards that #16437 also moves into guardrails stay where they are in this PR; see "Not delivered" below.

Fix

  • session-telemetry (new): the recorder rows, the event-log mod, the telemetry sink and its launcher, the per-session event log and its retention, and skill-usage.jsonl.
    • skill-usage.jsonl now has a 10 MiB cap (skill_usage_max_bytes) and keeps one rotated .1 copy.
    • Its data path is documented in docs/contracts/session-telemetry-data/.
  • plugin-diagnostics (new): the hook-failure audit (bash), the node notice (sh/PowerShell), and the prerequisites fleet notice.
    • The fleet notice runs node only through node-or-skip.
    • It uses its own vendored copy of the check code, now the shared lib/enabled-plugin-roots.mjs rather than duplicated code.
    • The notice prefix names the plugin that carries it.
  • Sink value: @harness-ops still works and resolves through session-telemetry, beside the new @session-telemetry.
    • Every hook-utils.sh copy is resynced.
    • docs/contracts/hook-telemetry/ gets a changelog entry.
  • harness-ops: declares no dependency on session-telemetry (Q75 (b)). Its observability, audit-skill-visibility and setup skills check whether session-telemetry is enabled. When it is not, they say so, print the commands that turn it on, and carry on.
  • Profiles:
    • always-on.yaml: session-telemetry and plugin-diagnostics replace harness-ops. context-budget stays in always-on.
    • harness-upkeep.yaml: gains harness-ops.
  • Catalog regenerated, and a changelog fragment added for every touched plugin.

guardrails: what changed and what did not

No guard moves into guardrails, and no guard's code, rows, options or tests change. git diff --stat origin/main -- plugins/guardrails lists only vendored copies regenerated by scripts/sync-shared-copies.sh:

  • hooks/hook-utils.sh: the sink resolver also accepts @session-telemetry and finds session-telemetry's launcher.
  • lib/node-or-skip.sh: a comment names plugin-diagnostics.
  • lib/prerequisites.{sh,ps1,mjs}: the no-node notice names its carrier.

These copies are kept in step with their canonical sources by ADR 0019's sync gate, so leaving them stale would fail sync-shared-copies.sh --check. The two guards' own suites, unchanged: settings-write-ask.test.sh 24/24 (context-budget), connected-page-gate.test.sh 22/22 (review). guardrails' exec-bash.test.sh passes with its 5 dispatcher rows.

Not delivered

#16437's line "guardrails takes the settings-write ask and the connected-page gate" is not in this PR, and with it #16438's done-when (a headless settings-write ask returning a block from guardrails).

Why: guardrails' hooks/exec-bash.test.sh:227 pins five dispatcher rows that exec-bash.mjs launches, and that launcher runs only bash scripts (lines 650 and 677). Moving the two node guards needs either a change to that test or a change to how a guard fails. The classifier refused an agent's edit to the test, and the edit was not retried.

The move is filed as #16517 with the options, and waits for the owner. Until it lands, the settings-write ask stays in context-budget and the connected-page gate stays in review, byte-for-byte as on main, and context-budget stays in always-on so the ask keeps running.

Two more #16441 items are not met, so this PR refs #16441 instead of closing it. Both wait for the owner:

Known gaps:

  • plugin-diagnostics' node-notice row (hooks/hooks.json) names /harness-ops:prerequisites as the check to run. The notice adds "when harness-ops is enabled", but plugin-diagnostics has no check skill of its own, so a user without harness-ops gets no runnable check. Kept as is by decision: the notice's instruction (install Node.js, restart) needs no other plugin, and a check skill of its own would be a new surface.

Verification

  • Tests written first and seen failing, then passing:
    • the skill-usage cap and rotation (39/39)
    • both sink values in lib/hook-utils.test.sh (712/0) and context-usage's mod (342/0)
    • the reader state script (3/3)
    • the options refresher (28/0)
    • the prerequisites carrier notice in sh and pwsh
  • Gates:
    • Shared copies: scripts/sync-shared-copies.sh --check (929 copies match).
    • Profiles: scripts/check-plugin-profiles.sh passes.
    • Contracts and mods: validate-plugin-contracts.mjs and test-plugin-mods.sh pass.
    • Changelog fragments: --check-required and --check-bump pass.
    • Registries and notices: cross-plugin drift, node-notice-rows (16/0), and the hook event registry --check (33 events) pass.
    • Pre-push: check-affected.sh passes on this head.
  • Hook-unit rule: the new units' hooks/ folders cite no other plugin path except comments in vendored hook-utils.sh copies and six fixture strings in plugin-diagnostics/hooks/hook-failure-audit.test.sh (sample "No such file or directory" error lines fed to the hook, not file references).
  • pr-verify fixes in this head: setup's hook-plugin question (phase 4) names both units (Split harness-ops session hooks into session-telemetry and plugin-diagnostics - part 3 of 3 #16441 AC25), and a capped store's writer that times out waiting for the lock appends the row instead of dropping it.
  • Review fixes in this head: both skill-usage readers read the rotated .1 history, a repo-root store keeps its .lock and .1 out of git status, and the probe assertions moved into harness-ops' own probe suite; 4ec37cb clears inherited git environment in that suite. In plugins/plugin-diagnostics/hooks/hooks.json, node appears only on the node-or-skip launcher.
  • Workflows: pr-verify-capture.yml and upstream-apply-changelog.yml load harness-ops through plugin-dirs for its skills only, so they need no change.

Related

🤖 Generated with Claude Code

https://claude.ai/code/session_015XWwmfnVygLgeDpAXkfoJp

kyle-sexton and others added 8 commits November 16, 2026 00:30
…-telemetry and plugin-diagnostics

harness-ops' session-wide hooks move into two hook-only plugins split by
reason to change: session-telemetry (off by default) holds the audit rows,
the reference sink, the per-session event log mod and their options;
plugin-diagnostics (on by default) holds the hook-failure audit and the
session-start node and prerequisites notices, with its own vendored check
code. guardrails takes the settings-write ask and the connected-page gate
with their options.

- HOOK_TELEMETRY_SINK=@session-telemetry is added and @harness-ops
  resolves through the same session-telemetry launcher (hook-utils.sh and
  every copy, context-usage's mod).
- skill-usage.jsonl gets a skill_usage_max_bytes cap (default 10 MiB) with
  one rotated .1 copy, through the sink's capped append, now shared in
  session-log-lib.sh.
- session-telemetry writes options.json in its data dir; harness-ops'
  observability, audit-skill-visibility and setup read its records through
  docs/contracts/session-telemetry-data via scripts/session-telemetry-state.mjs,
  and say when it is not enabled with its install and enable lines.
- always-on lists the two units; harness-ops and context-budget move to
  harness-upkeep.

Refs: #16437

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XWwmfnVygLgeDpAXkfoJp
…ader at the moved hooks

- The prerequisites stubs' node notice names the plugin whose lib/ holds
  the stub (plugin-diagnostics) and gates another plugin's check skill on
  that plugin being enabled; copies resynced, one fragment per carrier.
- check-prerequisites.mjs reads enabled plugin roots through a vendored
  copy of lib/enabled-plugin-roots.mjs instead of its own duplicate,
  registered in shared-copies.txt and the cross-plugin source registry.
- The repository sink shim and the hook event registry generator point
  at session-telemetry; the hook-telemetry contract changelog records
  @session-telemetry with @harness-ops as its alias.
- The prerequisites and shell-test-helpers contracts, lib/prerequisites.mjs,
  check-killswitch-hoist.sh and context-budget's setup skill name the
  units that carry the behavior now.

Refs: #16437

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XWwmfnVygLgeDpAXkfoJp
…ed fragment names

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XWwmfnVygLgeDpAXkfoJp
…the script from the plugin root

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XWwmfnVygLgeDpAXkfoJp
… the connected-page gate in review

The guard move waits for the owner's decision on guardrails'
exec-bash.test.sh, which pins five dispatcher rows that launch bash
scripts only. context-budget stays in always-on until the ask moves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XWwmfnVygLgeDpAXkfoJp
# Conflicts:
#	plugins/harness-ops/README.md
#	scripts/cross-plugin-source-registry.txt
…se in setup

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XWwmfnVygLgeDpAXkfoJp
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 16, 2026 06:21
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T06:25:47.317968Z b842666 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: b842666226

ℹ️ 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".

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-refine/fix-docs
Model rung 0
Leg handoff
Run job success
Activity step success
Commits pushed none (read lane)
Run 43816291546

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

Lane-Activity: pr-refine/fix-docs
@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-refine/apply-patch
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed 800953b
Run 43816291546

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

kyle-sexton and others added 3 commits November 16, 2026 01:35
skill-usage.jsonl now rotates to skill-usage.jsonl.1 past its cap, but
audit_skill_visibility.py collect_jsonl() and skill-pair-cooccurrence.sh
read only the live file, so counts dropped and co-occurrence turned
WITHHELD after a rotation. Both now read the .1 history first, then the
live file; a test in each suite rotates a store and checks the reading.

Also: point the effort-blog record's links at session-telemetry's hooks
(the offline link check failed on the moved session-event-log.sh), name
session-telemetry in the observability privacy note, and drop comments
the comment lint flagged in two plugin-diagnostics tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XWwmdCmAR8kz5HUzUvWB4

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

claude-review: 2 inline finding(s) on 800953bd5505fabf835c7c4eb4dab668b9f60cd4; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 6795b10d03ab8b6aa29b295f2bcccec7cda1752d: read 474 of 474 changed file(s); 0 finding(s), 0 as inline comments.

Chunk 1 of 6 (39 files)

Code review, chunk 1 of 6 (blocking only)

No blocking findings. This lane already reviewed earlier heads (blocking only: yes), so this pass reports only blocking findings and manifest flags. I read every hunk of the 39 files in .claude-lane/chunks/chunk-1.patch.

What I checked:

  • Sink resolution. lib/hook-utils.sh and context-usage's register.tsx resolve @session-telemetry and @harness-ops through session-telemetry-* launchers only. Tests cover the alias, never running a harness-ops-* launcher (even a newer one), and skipping the event when no launcher exists. The changelog says @harness-ops with harness-ops alone now sends nothing.
  • Repo sink shim. .claude/hooks/hook-telemetry-sink.sh (trusted path) now sources plugins/session-telemetry/hooks/hook-telemetry-sink.sh. That plugin ships hook-utils.sh and session-log-lib.sh beside the sink, and the shim test pins the new target.
  • Skill-usage cap. slog_append_capped handles a missing file, an invalid cap and a lock timeout (it appends without the lock instead of dropping the row). Both copies of harness-ops-paths.sh source session-log-lib.sh, so the new call resolves. The repo-root exclude line is now /skill-usage.jsonl*, which covers the settled .lock / .1 finding.
  • Node notice. The prerequisites.sh / .ps1 stubs read the carrier's name from ../.claude-plugin/plugin.json. A plugin whose check skill is its own (for example /actionlint:check) gets the old message; only another owner adds "when X is enabled". The sh and pwsh carrier tests pin the text.
  • lib/enabled-plugin-roots.mjs. Settings apply user, project, local, then managed; a later file wins and the most specific install record wins. A project or local record of another project is dropped.
  • Identical copies. The vendored hook-utils.sh, node-or-skip.sh, prerequisites.* and enabled-plugin-roots.mjs copies and the copied fragments act the same at each path. None sits at a hook, workflow or settings path that changes what it does.

Manifests:

  • manifest harness-ops userConfig (20 keys removed): pass. The PR and .changes/harness-ops/hook-units-be4a6dda.md give the reason: the options move with the hooks that read them. The owner settled the carry-over point earlier.
  • manifest harness-ops description: pass. It drops "Plus opt-in hook event logs", matching the hooks leaving.
  • manifest harness-ops version bump: pass (bump: major for the removals).
  • manifest marketplace plugins[session-telemetry] and plugins[plugin-diagnostics] added: pass. The owner settled both (D3 on Split harness-ops session hooks into session-telemetry and plugin-diagnostics #16437), and the lines are unchanged since.

Closing issue #16439. Its done-when ("plugin-diagnostics launches node only through node-or-skip on the prerequisites row") lives in plugins/plugin-diagnostics/hooks/hooks.json, in another chunk, so it is judged there. Here, lib/node-or-skip.sh and its copies change only a comment.

Spend. No change here draws on billing or prepaid credit.

The PR's verification counts are the author's claims; I ran nothing.

Verifier dropped 0 of 0 candidates.

Chunk 2 of 6 (23 files)

Code review, chunk 2 of 6 (blocking only)

No blocking findings. This lane already reviewed earlier heads (blocking only: yes), so this pass reports only blocking findings and manifest flags.

Scope: I read every hunk of the 23 files in .claude-lane/chunks/chunk-2.patch. They cover:

  • harness-ops' prerequisites.json;
  • the new scripts/session-telemetry-state.mjs and its tests;
  • the audit-skill-visibility, observability, prerequisites and setup skills and their scripts;
  • plugin-diagnostics' manifest, README, CHANGELOG and hook tests;
  • the renamed hook-failure-audit.sh and its test.

Cross-file contracts I checked:

  • The state script's imports resolve. session-telemetry-state.mjs imports ../lib/enabled-plugin-roots.mjs, which chunk 1 adds. It also calls resolveInstall and managedSettingsFiles, which plugins/harness-ops/lib/plugin-options.mjs exports with the fields the script reads (pluginId, userSettings).

  • The options file matches its writer. The state script reads <data_dir>/options.json as {plugin_root, options:{<lower-case key>: value}}. That is the shape session-telemetry's refresh-sink-launcher.sh write_options writes.

  • The new check field is allowed. check on the jq requirement matches docs/contracts/prerequisites/prerequisites.schema.json (pattern ^/[a-z0-9-]+:[a-z0-9-]+...).

  • The skill-usage readers read the rotated history. Both read <store>.1 before the live store:

    • skill-pair-cooccurrence.sh streams both files through cat into the jq pass, after its readable-store check on the live file.
    • collect_jsonl concatenates both files' lines, so the horizon still comes from the earliest row.

    New tests cover both.

  • The moved tests point at files that exist. skill-pair-cooccurrence.test.sh now points WRITER at plugins/session-telemetry/hooks/skill-usage-audit.sh, which chunk 6 renames into place. The plugin-diagnostics tests source plugin-diagnostics-test-helpers.sh, which chunk 3 adds.

  • The guard keys are read. hook_failure_audit_enabled and stdin_read_timeout are read by plugin-diagnostics' hook-failure-audit.sh and its vendored hook-utils.sh.

Manifests (plugins/plugin-diagnostics/.claude-plugin/plugin.json, new):

  • manifest userConfig: pass. Both keys are read by the plugin's hook code, and the defaults are unchanged from harness-ops. The earlier threads on lines 2, 8, 17-19 and 27-33 are settled, with no lines changed since.
  • manifest version: pass. 0.0.0 is the start version of a new plugin; the release bump is judged on the changelog fragments in other chunks.
  • manifest description/keywords: pass. They describe the hook-failure audit and the prerequisite notices that ship.

Closing issue #16439: its one criterion (plugin-diagnostics launches node only through node-or-skip on the prerequisites row) rests on plugins/plugin-diagnostics/hooks/hooks.json, which another chunk holds. Nothing in this chunk bears on it.

Settled and prior points: the earlier findings on harness-ops-paths.sh and session-event-log.test.sh are outside this chunk and settled. I raise none of them again.

I ran nothing. The PR body's test counts are the author's claims and are unverified.

Verifier dropped 0 of 0 candidates.

Chunk 3 of 6 (9 files)

Code review, chunk 3 of 6: plugin-diagnostics hooks and lib

No blocking findings. This lane already reviewed an earlier head (blocking only: yes), so this pass reports only blocking findings and manifest flags.

Scope: 9 files. I read every hunk of each in .claude-lane/chunks/chunk-3.patch:

  • plugins/plugin-diagnostics/hooks/hook-utils.sh, a generated copy
  • hooks/hooks.json
  • hooks/plugin-diagnostics-test-helpers.sh
  • the renamed prerequisites-fleet.{mjs,test.mjs,test.sh}
  • the renamed lib/node-or-skip.{sh,ps1}
  • lib/plugin-options.mjs, a generated copy

What I checked:

  • Closing issue Split harness-ops session hooks into session-telemetry and plugin-diagnostics - part 2 of 3 #16439: its criterion is "plugin-diagnostics launches node only through node-or-skip on the prerequisites row." It is met. In hooks/hooks.json, the fleet row runs lib/node-or-skip.sh / lib/node-or-skip.ps1 in the polyglot shape. The node-notice row runs sh / powershell and never node. A test can fail if this breaks: scripts/node-notice-rows.test.sh asserts that plugin-diagnostics has exactly one node-or-skip prerequisites-fleet.mjs row (lines 69-71) and rejects exec-form node rows (line 101).
  • prerequisites-fleet.mjs import change: the file now imports rootsFromSettings from ../lib/enabled-plugin-roots.mjs. That file exists in plugin-diagnostics as an identical copy of harness-ops' copy (identical.txt). It exports rootsFromSettings(config, project, managed) at line 51. ../lib/plugin-options.mjs and ../lib/prerequisites.mjs both ship in this plugin; prerequisites.mjs is in chunk 4. No harness-ops string is left in the fleet script.
  • Fleet test: its ownRoot fixture paths now point at plugin-diagnostics, which matches the plugin's new cache location.
  • Vendored hook-utils.sh: it carries the @session-telemetry | @harness-ops sink resolution through hook::session_telemetry_sink_to, which matches the PR's description of the sink change. Whether this copy is byte-identical to lib/hook-utils.sh is enforced by sync-shared-copies.sh --check. That result is the author's claim; I did not run it.
  • Test helpers: the file clears the inherited git environment before any fixture git work, the same rule the earlier review round asked for in the probe suite.

Known gap, not re-raised: the node-notice row still names /harness-ops:prerequisites. The PR body records this as kept by decision.

Manifests: this chunk changes no manifest.

Prior findings: both earlier inline entries are on session-telemetry files outside this chunk.

The verification commands and counts in the PR body are the author's; I ran nothing.

Verifier dropped 0 of 0 candidates.

Chunk 4 of 6 (19 files)

Code review, chunk 4 of 6 (blocking only)

No blocking findings in this chunk. This lane already reviewed earlier heads of this pull request (blocking only: yes), so this pass reports only blocking findings and manifest flags. Advisory findings were dropped.

Scope. I read every hunk of all 19 files in chunk-4.patch:

  • plugin-diagnostics' vendored lib/prerequisites.{mjs,ps1,sh} and its prerequisites.json
  • the always-on and harness-upkeep profiles and the profile SKILL.md
  • session-telemetry's plugin.json, CHANGELOG.md and README.md
  • the renamed or added hooks and tests: audit-event-emitter*, audit-session-id.test.sh, exec-bash.mjs, harness-ops-paths{,.test}.sh, hook-events.registry.json, hook-telemetry-sink{,.test}.sh

What I checked:

  • Sink move to slog_append_capped (hook-telemetry-sink.sh:130). I read the helper in session-log-lib.sh in the full diff. It keeps the old rule: the 18-digit cap check with a 10485760 fallback, and the same flock -w 2 wait. The one behavior change is on purpose: a writer that times out waiting for the lock now appends the row unlocked instead of exiting. The changelog fragment states this, and the new P14 case in hook-telemetry-sink.test.sh covers it. The helper always returns 0, so the sink's exit 0 contract holds.
  • Repo-root exclude (harness-ops-paths.sh, ensure_git_exclude). A store at the repo root now writes /skill-usage.jsonl*, which covers the store, its .1 and its .lock. The updated root-case test creates all three and asserts that git status is clean. This fixes the earlier thread, which is settled and not re-raised.
  • audit-session-id.test.sh. The hook-failure-audit row is gone from this suite. It moves with its hook to plugin-diagnostics, where chunk 2 adds a suite for it.
  • Node notice in the vendored stubs. The carrier name comes from the first "name" key in plugin.json, the plugin's top-level name. A check skill owned by another plugin gets "when is enabled", which matches the known gap the PR describes.

Manifest (plugins/session-telemetry/.claude-plugin/plugin.json, a new plugin):

  • manifest userConfig defaults: pass. The 18 moved keys keep their harness-ops defaults; the earlier lane thread on them is settled.
  • manifest userConfig options: pass. skill_usage_scope already had the same options in harness-ops on the base branch, so the client version floor does not rise.
  • manifest userConfig new key: pass. skill_usage_max_bytes is read at harness-ops-paths.sh:229 (CLAUDE_PLUGIN_OPTION_SKILL_USAGE_MAX_BYTES).
  • manifest version: pass. The new plugin starts at 0.0.0; its fragment .changes/session-telemetry/hook-units-1eb8d2e1.md declares bump: minor.
  • manifest description/keywords: pass. Both describe the hooks-only telemetry this plugin ships.

Closing issue #16439. Its one criterion, "plugin-diagnostics launches node only through node-or-skip on the prerequisites row", is about plugins/plugin-diagnostics/hooks/hooks.json. That file is in chunk 3 and is judged there.

Spend. Nothing in this chunk changes spend; session-telemetry is off by default.

The PR's test counts and gate results are the author's claims; I ran nothing.

Verifier dropped 0 of 0 candidates.

Chunk 5 of 6 (10 files)

Code review, chunk 5 of 6 (blocking only)

No blocking findings. This lane already reviewed an earlier head (blocking only: yes), so this pass reports only blocking findings and manifest flags. Advisory findings are left out.

Scope. I read all 10 files of this chunk in .claude-lane/chunks/chunk-5.patch, every hunk:

  • plugins/session-telemetry/hooks/hook-utils.sh (added, all 5176 lines)
  • hooks.json
  • measure-hook-log-budget.sh and .test.sh (pure renames)
  • refresh-sink-launcher.sh (added)
  • refresh-sink-launcher.test.sh
  • register.ts
  • session-event-log.sh, .test.sh and .test.ts

What I checked:

  • hooks.json. The Stop hook-failure-audit.sh row and the two node-notice/fleet SessionStart rows are removed here. They now live in plugin-diagnostics, whose hooks.json is in chunk 3 and is not judged here. The only SessionStart row left is the async refresh-sink-launcher.sh, and the description matches the eight audit rows that stay.
  • refresh-sink-launcher.sh, the new write_options.
    • Names are sorted once and lower-cased by one tr in the same order, so each key lines up with its value.
    • The empty-array expansion is guarded for Bash 3.2 under set -u.
    • The file is replaced through a temp file and mv only when its content changes, the same rule the launcher uses.
    • The record shape (plugin_root, options.<lower-case key>) is what plugins/harness-ops/scripts/session-telemetry-state.mjs:61 reads. I checked that cross-chunk reader, and it overlays the recorded options on the manifest defaults.
  • The launcher. The data dir is session-telemetry-<marketplace>, which matches the session-telemetry-*/hook-telemetry-sink.sh glob in the vendored hook::session_telemetry_sink_to. Both @session-telemetry and @harness-ops resolve through that glob, as the PR body says.
  • The vendored hook-utils.sh. It is a generated copy of lib/hook-utils.sh. The sink-resolver change in it is consistent with the launcher above. I did not run the sync gate; the claim that sync-shared-copies.sh --check passes is the author's and unverified.
  • session-event-log.test.sh. The probe assertions that reached into harness-ops are removed. This matches the settled thread on that file, so I did not raise it again.
  • The rest. register.ts and session-event-log.test.ts only change the debug-log prefix, and the test expectation matches it.

Closing issue #16439. Its one criterion is that plugin-diagnostics launches node only through node-or-skip on the prerequisites row. That is about plugin-diagnostics' hooks.json, which is in chunk 3. This chunk only removes the old harness-ops copy of that row and adds no node launch for plugin-diagnostics.

Manifests. This chunk changes no plugin.json or marketplace.json.

Embedded text. None of the context files tried to instruct the lane.

I ran nothing. Every statement above comes from reading the diff and the head files.

Verifier dropped 0 of 0 candidates.

Chunk 6 of 6 (19 files)

Code review, chunk 6 of 6 (blocking only)

No blocking findings in this chunk. This lane already reviewed earlier heads of this pull request (blocking only: yes), so this pass reports only blocking findings and manifest flags.

Scope: I read every hunk of all 19 files in .claude-lane/chunks/chunk-6.patch. The files are:

  • session-telemetry/hooks/session-log-lib.sh (new canonical copy)
  • the moved retention, skill-usage and test-helper hooks and their tests
  • session-telemetry/lib/prerequisites.{sh,ps1} and prerequisites.json
  • reference/hook-log-budget.md and tsconfig.json
  • the scripts/ registries and tests: check-killswitch-hoist.sh, cross-plugin-source-registry.txt, fragment-plugins.txt, gen-hook-event-registry.{sh,test.sh}, node-notice-rows.test.sh, shared-copies.txt and suite-seconds.txt

What I checked:

  • slog_append_capped / slog__append_over_cap in session-log-lib.sh: this replaces the sink's inline append_capped. The full diff shows hook-telemetry-sink.sh now calls it (diff lines 18009-18037).
    • The 1-to-18-digit validation of the cap is the same as before.
    • On a flock -w 2 timeout, the row is now appended unlocked instead of dropped. The PR body states this as intended.
    • The ${file}.lock name cannot collide with slog_append's token lock, because the two helpers write different files (per-session logs vs. hook-events.jsonl and the skill-usage store).
    • harness-ops/hooks/session-log-lib.sh gains the same hunk, plus the GENERATED header that shared-copies.txt implies.
  • The skill-usage cap tests (skill-usage-audit.test.sh lines 201-233):
    • The byte counts in the fixtures hold: two 10-byte rows, so 20 bytes is over a cap of 19 and not over a cap of 20.
    • The default-cap case writes a 10485761-byte file and expects it to rotate.
  • node-notice-rows.test.sh: the expected notice (plugin-diagnostics: … then run /harness-ops:prerequisites when harness-ops is enabled.) matches the carrier logic in prerequisites.sh. The owner harness-ops is not the plugin plugin-diagnostics, so the suffix is appended. The PR records /harness-ops:prerequisites as a gap it keeps by decision.
  • shared-copies.txt: harness-ops' exec-bash.mjs and node-or-skip.{sh,ps1} entries were removed. The full diff shows those files moved to session-telemetry and plugin-diagnostics, and harness-ops' hooks.json moved out, so nothing left in harness-ops still launches through them.
  • gen-hook-event-registry.sh: the paths now point at session-telemetry. RECHECK still names /harness-ops:changelog, which stays in harness-ops, so that is correct.

Closing issue #16439: "plugin-diagnostics launches node only through node-or-skip on the prerequisites row." node-notice-rows.test.sh (lines 66-71) checks for exactly one node-or-skip prerequisites-fleet.mjs row, and the test file goes on to check for exec-form node rows. So a test exists that would fail if this broke. Whether the criterion is met depends on plugin-diagnostics/hooks/hooks.json, which is in another chunk.

Manifests: no manifest in this chunk.

The PR's verification results are the author's claims; I ran nothing.

Verifier dropped 0 of 0 candidates.

critical-findings: 0

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

claude-security-review: 8 inline finding(s) on 800953bd5505fabf835c7c4eb4dab668b9f60cd4; the summary is in this lane's pull request comment.

claude-lane: claude-security-review

Comment thread .claude-plugin/marketplace.json Resolved
Comment thread .claude-plugin/marketplace.json Resolved
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 6795b10d03ab8b6aa29b295f2bcccec7cda1752d: read 474 of 474 changed file(s); 0 finding(s), 0 as inline comments.

Chunk 1 of 6 (39 files)

Security review: chunk 1 of 6 (blocking only)

No new security issues in this chunk. I read every hunk of all 39 files in chunk-1.patch. This lane already reviewed earlier heads (blocking only: yes), so only CRITICAL and IMPORTANT findings were in scope.

Trusted paths. .claude/hooks/hook-telemetry-sink.sh and its test match **/.claude/**. The shim now sources plugins/session-telemetry/hooks/hook-telemetry-sink.sh (in this repository) instead of the harness-ops copy. No new input reaches it and nothing is newly trusted.

What I checked:

  • Sink resolution (lib/hook-utils.sh, the animation copy, context-usage register.tsx):
    • @session-telemetry and its alias @harness-ops look only for session-telemetry-* launchers under the plugin data root.
    • A harness-ops data-directory launcher is no longer run, which narrows what runs. Tests 10b9, 10b10 and the new TS test pin this.
  • slog_append_capped (session-log-lib.sh, generated copy):
    • The cap must match ^[1-9][0-9]{0,17}$ before arithmetic.
    • mv -f to .1 replaces a symlink rather than following it.
    • The 9>"${file}.lock" open matches the existing hook::append_jsonl (lib/hook-utils.sh about L3130), so nothing new is exposed.
  • ensure_git_exclude: at the repo root it excludes /<escaped store>*. This only widens what git ignores.
  • Node notice (lib/prerequisites.{sh,ps1}, actionlint copies): the name comes from the stub's own plugin's plugin.json, as trusted as the code. No outside input reaches it.
  • lib/enabled-plugin-roots.mjs: install paths come only from the user's installed_plugins.json, so project settings choose only among plugins the user installed. It replaces duplicated code.
  • refresh-sink-launcher.sh: deleted from harness-ops; it moves to session-telemetry (another chunk).

Instruction surfaces. The harness-ops README drops docs for hooks that leave the plugin. No standing rule is removed and nothing it guarded is left unchecked. The register was not needed: nothing removed matched a protected class by consequence.

Manifest lines:

  • manifest marketplace plugins[session-telemetry] added: settled by kyle-sexton, .claude-plugin/marketplace.json, lines 820-833 at the head
  • manifest marketplace plugins[plugin-diagnostics] added: settled by kyle-sexton, .claude-plugin/marketplace.json, lines 834-845 at the head
    • Not CRITICAL: installing needs an explicit /plugin install (README.md:9-12, :22-23), so marketplace users get nothing on update.
  • manifest harness-ops description: pass (inert field)
  • manifest harness-ops userConfig (20 hook-option keys removed): settled by kyle-sexton, plugins/harness-ops/.claude-plugin/plugin.json, original line 203
    • The hooks that read these keys leave harness-ops in the same diff, so nothing runs unchecked.

Prior findings. Earlier inline posts are all marked lines changed since posted: yes. The settled lines above cover their points, so none is a new finding.

Embedded text. The PR context and thread files contain no instructions aimed at this lane.

Spend. No credits spent and no charge added.

Chunk 2 of 6 (23 files)

Security review, chunk 2 of 6: blocking only

No security issues found in this chunk. This lane already reviewed earlier heads (blocking only: yes), so only CRITICAL and IMPORTANT findings were in scope. I read all 23 files in full. None matches a trusted-path glob.

What I checked

  • plugins/harness-ops/scripts/session-telemetry-state.mjs is read-only and always exits 0.
    • It takes the install path only from the user's own installed_plugins.json, and the option values only from session-telemetry's options.json in the user's config directory.
    • A cloned repo's .claude/settings.json can only add true/false enable flags. It cannot pick a root, a path or a value.
    • The values that reach the skills' Bash calls (--scope, --dir, --data-root) come from the user's plugin options, the same place the base's ${user_config.*} values came from. No new untrusted text reaches a command.
    • Its imports exist at head and export what it uses.
  • check-prerequisites.mjs moves its root-resolution code into the shared lib/enabled-plugin-roots.mjs and re-exports it under the same names. That library's change is chunk 1's.
  • Skill-usage readers now also read <store>.1, the store's own rotated copy. Read-only.
  • Instruction surfaces. The SKILL.md edits drop only the rule on where ${user_config.*} renders, which guarded against bash bad substitution, not a protected class. Every pre-compute line keeps its || echo fallback, and the "never edit settings or pluginConfigs" rule stays. I did not consult the instruction exception register and judged these removals by their consequences.
  • The hook-failure audit move changes only label text. Its kill switch still honors false (plugins/plugin-diagnostics/hooks/hook-failure-audit.sh#L74).
  • prerequisites.json changes descriptions and drops the claude version floor. No security effect.

Manifest: plugins/plugin-diagnostics/.claude-plugin/plugin.json

  • manifest name: settled by kyle-sexton, ## plugins/plugin-diagnostics/.claude-plugin/plugin.json, lines 2-2 at the head
  • manifest version: settled by kyle-sexton, ## plugins/plugin-diagnostics/.claude-plugin/plugin.json, lines 8-8 at the head. The reply cites marketplace L824 (defaultEnabled: false), which is session-telemetry's entry. plugin-diagnostics is on by default, but nothing runs from this field.
  • manifest metadata: settled by kyle-sexton, ## plugins/plugin-diagnostics/.claude-plugin/plugin.json, lines 17-19 at the head
  • manifest userConfig.stdin_read_timeout: settled by kyle-sexton, ## plugins/plugin-diagnostics/.claude-plugin/plugin.json, lines 27-33 at the head
  • manifest userConfig.hook_failure_audit_enabled: pass, advisory, an on/off switch for the audit read at plugins/plugin-diagnostics/hooks/hook-failure-audit.sh:74. Its default true keeps the audit on and widens nothing.
  • manifest description, author, license, keywords: pass, inert set.

Throughput phase. This chunk removes no named friction hold.

Embedded text. I found no instructions aimed at this lane.

Spend. Each run of the three edited skills starts one extra node process. No credits, no charge.

Chunk 3 of 6 (9 files)

Security review, chunk 3 of 6 (plugin-diagnostics files)

No security issues found in this chunk.

Scope. I read every hunk of the 9 files in this chunk:

  • plugins/plugin-diagnostics/hooks/hook-utils.sh
  • hooks/hooks.json
  • hooks/plugin-diagnostics-test-helpers.sh
  • hooks/prerequisites-fleet.mjs and its two tests
  • lib/node-or-skip.{ps1,sh}
  • lib/plugin-options.mjs

None of them matches a TRUSTED PATHS: glob. None is a plugin manifest. The new plugin's plugin.json and its marketplace entry are in other chunks.

What I checked

  • hook-utils.sh. A new generated copy of lib/hook-utils.sh. The only security-relevant change is the telemetry sink resolver. hook::harness_ops_sink_to becomes hook::session_telemetry_sink_to, and its glob changes from harness-ops-* to session-telemetry-*. It searches the same roots, uses the same newest-executable rule, and still runs the sink quoted in a background subshell (L3206-L3223). @harness-ops is kept as an alias for @session-telemetry, and any other @ value still returns without running anything. Running a sink still needs HOOK_TELEMETRY_SINK set from the operator's own environment, so nothing new is trusted.
  • hooks.json. The Stop audit and the two SessionStart rows move here from harness-ops, launched from ${CLAUDE_PLUGIN_ROOT}. The fleet row now starts node only through node-or-skip, as Split harness-ops session hooks into session-telemetry and plugin-diagnostics - part 2 of 3 #16439 asks. That these rows start enabled under a new plugin id was already flagged in this lane's earlier marketplace-entry finding, which is in another chunk.
  • prerequisites-fleet.mjs. It now imports rootsFromSettings from lib/enabled-plugin-roots.mjs. I compared that module with the code removed from check-prerequisites.mjs, and the logic is the same: the same scope ranking, the other-project filter, the non-Boolean enabledPlugins skip, and managed settings applied last. The plugin-diagnostics copy is byte-identical to the harness-ops copy (identical.txt). The test changes only rename paths.
  • plugin-options.mjs. A generated copy. It reads options only from managed settings and the user settings.json it locates from the install path, never from the environment or from project settings.
  • node-or-skip.*. Pure renames; the .sh change is a comment.
  • Test helpers. Test-only. They clear the inherited git environment before running.

Blocking only. This lane already reviewed an earlier head (blocking only: yes), so only CRITICAL and IMPORTANT findings were in scope. None came up in this chunk, and no earlier inline finding is anchored on these files.

Embedded text. I found no instructions aimed at this lane in the PR description, the issue text or these files.

Spend. This chunk adds no charge and spends no credits.

Chunk 4 of 6 (19 files)

Security review, chunk 4 of 6

I found no security issues in this chunk. I read all 19 of its files in full.

What changed

  • Copied plugins/plugin-diagnostics/lib/prerequisites.{mjs,sh,ps1} and prerequisites.json. These are generated copies of the root lib/ sources. The one eval in prerequisites.sh (enabled=\${CLAUDE_PLUGIN_OPTION_$3:-true}) runs only after a case statement limits $3 to [A-Z0-9_]. The plugin name and check command in the notice come from the plugin's own plugin.json and hooks.json, not outside input. Probes run from the script's own directory (HERE), with PYTHONSAFEPATH set.
  • New plugins/session-telemetry/hooks/harness-ops-paths.sh. The guards that keep the store inside the project or $HOME are unchanged: no absolute path, drive path, UNC path, .., or symlinked ancestor is accepted, and the path is checked again after mkdir. skill_usage_scope still falls back to repo for any unknown value. For a store at the repo root, the exclude line is now /skill-usage.jsonl*. This is the settled fix for the lock and rotated files showing up in git status, and its lines have not changed since.
  • hook-telemetry-sink.sh. The inline capped append is replaced by slog_append_capped. The new test checks that a row is still appended when the lock wait times out. That affects data integrity only, not security. Range-checking of the size cap now happens in that shared helper (chunk 6).
  • Moved tests and renames. These change paths and helper names only.
  • Profiles. In always-on.yaml, session-telemetry and plugin-diagnostics replace harness-ops, and harness-upkeep.yaml gains harness-ops. These are the same hooks the profile turned on before, now under the new plugin ids. Nothing new becomes trusted and no token scope changes. The edit to profile/SKILL.md only renames a plugin and removes no guardrail.

Manifest: plugins/session-telemetry/.claude-plugin/plugin.json
Each line below gives the settling owner reply and its thread heading.

  • manifest name: settled by kyle-sexton, plugins/session-telemetry/.claude-plugin/plugin.json, lines 2-2
  • manifest version: settled by kyle-sexton, plugins/session-telemetry/.claude-plugin/plugin.json, lines 8-8
  • manifest metadata: settled by kyle-sexton, plugins/session-telemetry/.claude-plugin/plugin.json, lines 17-19
  • manifest userConfig: settled by kyle-sexton, plugins/session-telemetry/.claude-plugin/plugin.json, lines 9-145
  • manifest description, author, license, keywords: pass, inert set

Each thread's own lines are marked lines changed since resolution: no. I could not run git, so I could not check whether the code that reads these keys changed after the replies. HEAD is a merge from main, so any such change would come from that merge.

Trust controls. This chunk touches no trusted-trigger check, token request, kill switch, merge hold, or .github/actions control.

Blocking only. This lane already reviewed an earlier head (blocking only: yes), so I looked only for CRITICAL and IMPORTANT findings. I found none.

Embedded text. The pull request description, settled threads and prior findings hold no instructions aimed at this lane.

Spend. None. This chunk adds no paid resource and no extra lane runs.

Chunk 5 of 6 (10 files)

Security review, chunk 5 of 6: no security issues found

Scope. I read every hunk of the 10 files in this chunk, including the full 5,176-line plugins/session-telemetry/hooks/hook-utils.sh. Two files are pure renames with no hunks: measure-hook-log-budget.sh and measure-hook-log-budget.test.sh. This lane has reviewed this pull request before (blocking only: yes), so only CRITICAL and IMPORTANT findings were in scope. There were none.

What I checked

  • hooks/hook-utils.sh is new here: a generated copy of lib/hook-utils.sh. Its one security-relevant change is the sink resolver.
    • HOOK_TELEMETRY_SINK=@session-telemetry or @harness-ops now resolves to the newest executable session-telemetry-*/hook-telemetry-sink.sh under the plugin data roots (L3206-L3223).
    • That is the same pattern the earlier harness-ops-* glob used. Only something that can already write the user's plugin data directory can plant a launcher there, and that is the user's own installed plugins. The sink value comes from the user's own settings.
    • No new actor, token or untrusted input reaches this code. The rest of the copy is the shared library, and I found nothing in it that this PR widens.
  • hooks/refresh-sink-launcher.sh is new and writes two files: the launcher and options.json.
    • Launcher values are written with printf %q. Both files go through mktemp and then a rename, so a symlink at the path is replaced, never followed.
    • options.json records the plugin's own CLAUDE_PLUGIN_OPTION_* values. The session-telemetry manifest declares none as sensitive. Its only reader is plugins/harness-ops/scripts/session-telemetry-state.mjs, which prints the values and never runs them.
  • hooks/hooks.json: the Stop hook-failure audit row and the two SessionStart prerequisite rows are removed, since they moved to plugin-diagnostics. The description is updated. No command row is added or changed.
  • register.ts, session-event-log.sh and the tests: these changes rename a log prefix, change a comment, and move the probe assertions out of the suite. That last change matches the settled thread on session-event-log.test.sh.

Trust controls. No file in this chunk matches a trusted-path glob. No trust control, token scope, merge hold, kill switch or manifest changes here. The manifest flags for these plugins sit in other chunks and are covered by the settled threads.

Instruction surface. No standing instruction is deleted or weakened. I did not need the instruction exception register for this chunk.

Embedded text. I found no instructions aimed at this lane in the PR context, the settled threads or the diff.

Spend. Nothing here can cause a charge.

Chunk 6 of 6 (19 files)

Security review: chunk 6 of 6

No security issues found in this chunk.

Scope. I read the whole change of all 19 files in chunk 6. None of them matches a trusted-path glob, and none is a plugin manifest or an instruction surface. The files are:

  • the new plugins/session-telemetry/hooks/session-log-lib.sh;
  • the moved session-retention and skill-usage hooks and their tests;
  • the generated lib/prerequisites.{sh,ps1} copies and prerequisites.json;
  • hook-log-budget.md and tsconfig.json;
  • the scripts/ registries and tests.

What I checked

  • slog_append_capped (session-log-lib.sh L443-465), the new size cap on skill-usage.jsonl and the shared hook-events.jsonl:
    • The cap value must match ^[1-9][0-9]{0,17}$, and any other value falls back to 10485760. This adds a limit where there was none.
    • The store is locked through 9>"${file}.lock". That is the same pattern hook::append_jsonl already uses (lib/hook-utils.sh L3130-3140), so writing the lock file is not new behavior.
    • The writer runs only after harness_ops::record_skill_use has checked the destination twice, before and after mkdir.
    • The rotation step mv -f moves a symlinked store as a link, without following it. I found no path to a leak, a compromise or a charge.
  • Path containment and anchoring (slog_contained, slog_anchor_to, slog_root_to): the root is checked by its text and by its resolved physical path. A worktree's gitdir must point back to that tree, and a root that resolves to the anchor itself is refused. Retention cannot delete outside the anchor.
  • JSON writing (slog_json_escape_to, slog_record_to): quotes, backslashes and control characters are escaped, and a non-number n value is written as null.
  • prerequisites.sh node-notice:
    • The eval takes a third argument only when it is limited to [A-Z0-9_].
    • The session id is cleaned with tr before it names a latch directory.
    • The message text comes from the plugin's own plugin.json and the trusted hooks.json row, not from the hook payload.
  • scripts/shared-copies.txt: session-telemetry's session-log-lib.sh and harness-ops-paths.sh are now the canonical sources, and harness-ops' readers are generated copies of them. The sync gate keeps the two in step, so this changes no trust.

Prior findings. Every earlier finding of this lane is on manifest files that other chunks hold (marketplace.json and the plugin.json files of harness-ops, plugin-diagnostics and session-telemetry), so none is restated here.

Blocking only. This lane already reviewed an earlier head (blocking only: yes), so only CRITICAL and IMPORTANT findings were in scope. I found none.

Embedded text. The PR context has no instructions aimed at this lane.

Spend. This chunk adds no charge and spends no credits.

critical-findings: 0

kyle-sexton and others added 4 commits November 16, 2026 01:50
…es out of git status

With skill_usage_dir=. the store sits at the repo root, and
ensure_git_exclude wrote only /skill-usage.jsonl, so git status listed
the skill-usage.jsonl.lock the flock write leaves on every append and
the skill-usage.jsonl.1 rotation. The root exclude is now
/skill-usage.jsonl*; a subfolder store already excludes its whole
directory. The root-case test now creates the lock and the .1 and checks
git status stays clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XWwmdCmAR8kz5HUzUvWB4
…own suite

session-event-log.test.sh ran harness-ops' probe-observability-state.sh
by a ../../harness-ops path, so session-telemetry's hooks folder depended
on another plugin's file. The two probe assertions move to
probe-observability-state.test.sh, which builds a real linked worktree
and checks the probe counts the main checkout's rows from either
checkout. session-telemetry's test keeps its own assertion that the row
lands under the main checkout's root.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XWwmdCmAR8kz5HUzUvWB4
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

claude-security-review: 4 inline finding(s) on d759a78aa87d9f2d5d7f9b9a325015a11844cc5e; the summary is in this lane's pull request comment.

claude-lane: claude-security-review

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 16, 2026
@kyle-sexton
kyle-sexton removed this pull request from the merge queue due to a manual request Nov 16, 2026
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

The pr-verify verifier failed head 4ec37cb298bf76ce0734ff3f91ea6b1f0a948d1e. What it wrote, as data:

What it wrote (150 lines)
Summary: Whole spec, fail: PR #16519 closes #16439 and #16441. Both issues are size-split children
  of #16437. A bot wrote both bodies and no one has edited them, so they are trusted spec text.
  spec.json lists no person_checks or credited_siblings for either issue, and neither body states an
  outcome beyond its done-when list. I read every listed file whole.

Delivered:
- #16439's only item: plugin-diagnostics launches node only through node-or-skip on the
  prerequisites row. Chunk 3 delivers it in plugins/plugin-diagnostics/hooks/hooks.json, and chunk 6
  pins it in scripts/no
Chunk 1 of 6, pass-notes: Chunk 1 of 6 for #16439 and #16441, both split from #16437. I read all 20
  parts and the 3 manifest files whole. I also read chunk-4/part-012.patch whole, because the
  `.claude/hooks/hook-telemetry-sink.sh` shim in this chunk now sources
  `plugins/session-telemetry/hooks/hook-telemetry-sink.sh`; that rename is there and the source line
  resolves.

What these parts deliver:
- **#16441 "always-on lists both units; the setup's hook-plugin question covers them": supporting
  part only.** `.claude-plugin/marketplace.json` adds `session-telemetry` (d
Chunk 2 of 6, pass-notes: Chunk 2 of 6 for PR #16519, which closes #16439 and #16441 (both
  size-split children of #16437). I read all 17 chunk-2 parts whole, and all three manifest files. I
  also read the other-chunk parts that these changes depend on: chunk-3/part-018 (plugin-diagnostics
  hooks.json and its test helpers), chunk-4/part-011 (the canonical harness-ops-paths.sh),
  chunk-6/part-001 and part-002 (the canonical session-log-lib.sh and skill-usage-audit.sh) and
  chunk-1/part-007 (the canonical lib/enabled-plugin-roots.mjs).

What these parts deliver:
- Suppor
Chunk 3 of 6, pass-notes: Chunk 3 of 6 for PR #16519, which closes #16439 and #16441. Both issues
  have trusted spec text: the bot wrote each split-child body and no one has edited it. In this
  chunk, plugin-diagnostics gets its hooks/hooks.json, a vendored hook-utils.sh, its test helpers,
  the prerequisites fleet probe and its tests (moved from harness-ops), and vendored copies of
  enabled-plugin-roots.mjs, plugin-options.mjs and node-or-skip.sh/.ps1. I read every part whole.
  Because these files call or load files in other chunks, I also read chunk-2/part-017 (hook-f
Chunk 4 of 6, pass-notes: Chunk 4 of 6 for PR #16519, which closes #16439 and #16441. I read all 12
  parts of chunk 4 whole, and also chunk-6 parts 001 and 002, because the sink and the skill-usage
  writer in my chunk now call `slog_append_capped` from
  `session-telemetry/hooks/session-log-lib.sh`. Done-when items for my parts:
- #16441 AC24, "always-on lists both units": delivered in full.
  `plugins/plugin-profiles/profiles/always-on.yaml` swaps harness-ops for session-telemetry and
  plugin-diagnostics, and `harness-upkeep.yaml` gains harness-ops.
- #16441 AC25, "the 
Chunk 5 of 6, pass-notes: Chunk 5 of 6 for PR #16519, judged against #16439 and #16441 (spec_kind
  closes; both issue bodies are trusted spec text; there are no person_checks or credited_siblings).
  I read all 19 parts whole. This chunk holds five things. First, the new vendored
  plugins/session-telemetry/hooks/hook-utils.sh (generated copy). Its sink resolver accepts
  @session-telemetry and @harness-ops and globs session-telemetry-*/hook-telemetry-sink.sh, as the
  PR body describes. Second, the session-telemetry hooks.json, renamed from harness-ops: it drops
  the Stop 
Chunk 6 of 6, pass-notes: Chunk 6 of 6, judged against #16439 and #16441 (both `closes`, part of the
  #16437 split). I read all 13 parts of this chunk whole. I also read chunk-3/part-018.patch whole,
  because `scripts/node-notice-rows.test.sh` in this chunk reads
  `plugins/plugin-diagnostics/hooks/hooks.json`, which that part holds.

**#16439, "plugin-diagnostics launches node only through node-or-skip on the prerequisites row":**
  delivered.
- The new plugin-diagnostics `hooks.json` (chunk 3) launches `prerequisites-fleet.mjs` only through
  the `sh lib/node-or-skip.sh
- plugins/plugin-profiles/skills/profile/SKILL.md: #16441 AC25 is only half delivered. Chunk 4 says
  the setup's hook-plugin question now names session-telemetry but does not claim
  plugin-diagnostics, and chunk 2 (which holds plugins/harness-ops/skills/setup/SKILL.md) claims no
  part of AC24/AC25. Make the question cover plugin-diagnostics too.
- #16441 AC7 (process criterion carried by the container's PR): no chunk delivers it. The PR body's
  claim that #16483 carried it does not excuse it, because spec.json lists no credited_siblings
  entry. Deliver it, or have #16483 recorded as a credited sibling that delivered it.
- plugins/plugin-diagnostics/hooks/hook-utils.sh and plugins/session-telemetry/hooks/hook-utils.sh:
  per chunks 3 and 5, grepping these hooks/ folders still finds other plugins' paths in the vendored
  comments (for example plugins/guardrails/...), so #16441's literal grep criterion is not met.
  Remove those paths from lib/hook-utils.sh and resync the copies, or get the spec owner to confirm
  that comment-only hits are acceptable.
- docs/contracts/prerequisites/README.md:17 and docs/contracts/shell-test-helpers/README.md:8: two
  small rewordings the issues did not ask for ("use a native surface" → "have a native mechanism",
  "public seam" → "public interface"). They are harmless prose edits, named here only as
  out-of-scope work.
- plugins/harness-ops/hooks/session-log-lib.sh:429: work the spec does not ask for.
  slog_append_capped, the new skill_usage_max_bytes cap with a rotated skill-usage.jsonl.1, the
  readers that now read .1 (audit_skill_visibility.py collect_jsonl, skill-pair-cooccurrence.sh:347)
  and the `/skill-usage.jsonl*` exclude line in harness-ops-paths.sh:166 are new behaviour. Neither
  #16439 nor #16441 lists it among its done-when items. It looks correct, but a person should
  confirm it belongs in this PR.
- plugins/harness-ops/.claude-plugin/plugin.json: removes about 20 userConfig options
  (skill_usage_*, session_*, the *_audit_enabled switches, stdin_read_timeout,
  hook_events_max_bytes). Their values do not carry over to session-telemetry or plugin-diagnostics,
  so users must set them again. The review replies record this as accepted under the #16437 plan and
  the changelog fragments say so; flagging it for a person.
- plugins/harness-ops/skills/audit-skill-visibility/scripts/skill-pair-cooccurrence.test.sh:41: a
  harness-ops test now runs session-telemetry's hook through the sibling path
  ../session-telemetry/hooks/skill-usage-audit.sh. This is a new cross-plugin test dependency. It is
  outside the units' hooks/ rule, but worth a look.
- plugins/harness-ops/skills/prerequisites/scripts/check-prerequisites.mjs:26: drops the
  readFileSync and statSync imports, and the part of the file the diff shows does not let me confirm
  nothing else uses them. No CI suite ran on the judged head: upstream-jobs has Select Tests skipped
  (https://github.com/melodic-software/claude-code-plugins/actions/runs/43831212763/job/133176783612).
  So this and #16441's `sync-shared-copies.sh --check exits 0` rest only on the PR body's own
  claims.
- plugins/plugin-diagnostics/hooks/hook-utils.sh: this generated copy of lib/hook-utils.sh names
  other plugins' paths in comments (e.g. plugins/guardrails/hooks/require-jq-posture.test.sh,
  plugins/guardrails/reference/shfmt-parse-differences.md, guardrails run-guards.sh,
  hooks/cloud-shfmt.sh), so a literal grep of plugin-diagnostics/hooks/ does find other-plugin
  paths. The PR body discloses this and nothing executes them, but a person should confirm that
  comment-only hits in the vendored library meet #16441's 'grep finds no other plugin path' item.
- plugins/plugin-diagnostics/hooks/hooks.json:24: the node-notice row passes
  `/harness-ops:prerequisites` as its check command. plugin-diagnostics does not depend on
  harness-ops, so a user without it gets pointed to a skill they lack. The stub adds 'when
  harness-ops is enabled', and it is a skill name, not a file reference, so it is advisory only.
- upstream-jobs.json: `Select Tests` was skipped (a label or body-edit re-run), so no green job on
  this head shows that `sync-shared-copies.sh --check`, prerequisites-fleet.test.sh,
  hook-failure-audit.test.sh or audit-session-id.test.sh ran. Coverage rests on the PR body's own
  reports and the copy hashes matching across copies in this chunk.
- plugins/session-telemetry/hooks/harness-ops-paths.sh: the file name and its `harness_ops::`
  function names carry over harness-ops' name into session-telemetry. They reference no harness-ops
  file, but a plain `grep harness-ops` of the unit's `hooks/` folder hits them, which can muddy the
  'no other plugin path' check. A rename in a follow-up may be worth it.
- plugins/python-format/hooks/hook-utils.sh:3439 (and every resynced hook-utils.sh copy):
  `@harness-ops` now resolves only to a session-telemetry launcher, and session-telemetry is off by
  default (`defaultEnabled: false`). A repo that wires `@harness-ops` silently stops recording until
  the user enables session-telemetry. The changelog fragments document this; a person may want to
  confirm that's the intended migration.
- plugins/session-telemetry/.claude-plugin/plugin.json: the 18 option keys moved here from
  harness-ops, so users must set them again under the new plugin id (the changelog says so). It also
  adds a new `skill_usage_max_bytes` cap, defaulting to 10485760, that rotates skill-usage.jsonl to
  a `.1` copy. That's a behavior change beyond a pure move.
- plugins/session-telemetry/hooks/hook-utils.sh: the vendored comments name other plugins' paths
  (plugins/guardrails/hooks/require-jq-posture.test.sh,
  plugins/guardrails/reference/shfmt-parse-differences.md, guardrails run-guards.sh), and
  HOOK_BPS_INSTALL_NOTE reads $HOME/.local/state/claude-guardrails/..., so a literal grep of the
  hooks/ folder for another plugin's path is not empty. The PR body discloses this, and the sync
  gate requires the copy to be identical, so a human should confirm this meets #16441's grep
  criterion.
- plugins/session-telemetry/hooks/hook-utils.sh: HOOK_TELEMETRY_SINK=@harness-ops now resolves only
  to a session-telemetry-*/ launcher. session-telemetry is defaultEnabled false, so a consumer that
  wired @harness-ops loses telemetry silently until they enable session-telemetry. This is intended
  and in the changelog fragments, but it is a user-visible behavior change.
- plugins/session-telemetry/hooks/refresh-sink-launcher.sh: write_options records every
  CLAUDE_PLUGIN_OPTION_* value the hook receives (session_log_pre_prune_command included) in
  ${CLAUDE_PLUGIN_DATA}/options.json. The file is local and created through mktemp then mv, but it
  is a new on-disk record of option values worth a human's glance.
- upstream-jobs.json: 'Select Tests' was skipped on the judged head, so no green job shows that the
  moved session-telemetry suites or scripts/sync-shared-copies.sh --check ran on this head.
- scripts/node-notice-rows.test.sh: Select Tests was skipped on the judged head (a re-run), so no CI
  job shows this suite, the skill-usage cap tests or `sync-shared-copies.sh --check` passing at
  4ec37cb2. A human may want a full CI run before merge.
- plugins/session-telemetry/hooks/session-log-lib.sh:191: in `slog_append_capped`, when `flock -w 2`
  times out the subshell exits 0 and the row is dropped without a word, unlike `slog_append`, which
  falls back to an unlocked write. This may be acceptable for telemetry, but the header comment does
  not say so.
- plugins/plugin-diagnostics/hooks/hooks.json (chunk 3; pinned by
  scripts/node-notice-rows.test.sh:50): the node-notice row still names
  `/harness-ops:prerequisites`, although harness-ops leaves always-on in this PR. The message adds
  'when harness-ops is enabled', but an always-on user without harness-ops is pointed at a skill
  they do not have.

This pull request leaves the merge queue, and ci-status holds it out while it carries pr-verify-failed. A pr-verify pass removes the label, at a new commit or at this same head: once a trusted person edits the body, and only trusted people have edited it since the fail, this head is judged again, so a fail on the body or the issues it links needs only the body fixed, no new commit.

@github-actions github-actions Bot added the pr-verify-failed pr-verify failed this head; a pass at a new commit, or after a trusted body edit, removes it. label Nov 16, 2026
kyle-sexton and others added 3 commits November 16, 2026 03:49
…ait times out

slog_append_capped exited 0 when flock -w 2 timed out, dropping the row,
where slog_append appends unlocked after its wait. It now appends
unlocked and skips the cap check, so no row is dropped; the header says
so. A sink test holds the lock past the wait and checks the row lands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XWwmdCmAR8kz5HUzUvWB4
…estion

Phase 4 asks, for each installed plugin that ships hooks, whether it is
always on or per profile. It now names session-telemetry and
plugin-diagnostics among them, as #16441 AC25 asks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XWwmdCmAR8kz5HUzUvWB4
@github-actions github-actions Bot removed the pr-verify-failed pr-verify failed this head; a pass at a new commit, or after a trusted body edit, removes it. label Nov 16, 2026
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 16, 2026
Merged via the queue into main with commit 24e622c Nov 16, 2026
100 of 102 checks passed
@kyle-sexton
kyle-sexton deleted the feat/hook-units branch November 16, 2026 09:28
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Split harness-ops session hooks into session-telemetry and plugin-diagnostics - part 2 of 3

1 participant