Skip to content

feat(harness-ops): derive the data id and make probe and OTEL targets configurable - #17406

Merged
kyle-sexton merged 6 commits into
mainfrom
fix/17208-harness-ops-org-agnostic
Nov 19, 2026
Merged

kyle-sexton merged 6 commits into
mainfrom
fix/17208-harness-ops-org-agnostic

Conversation

@kyle-sexton

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

Copy link
Copy Markdown
Member

Refs: #17208

This pull request delivers only the harness-ops part of #17208. It leaves to later work:

  • classifying every match of the issue's search as runtime behavior, instruction, permitted citation or test fixture;
  • the runtime and instruction cases in the other plugins, for example plugins/source-control/skills/babysit-prs/scripts/babysit_merge_policy.py (its decision-link match), plugins/work-items/skills/morning-brief/SKILL.md and plugins/review/skills/code-review/SKILL.md;
  • the CI check (scripts/check-skill-portability.sh or another) that fails when shipped content adds a new organization dependency.

Summary

harness-ops shipped organization-specific values: a fixed harness-ops-melodic-software data-directory id, a cloud-routine probe hardwired to this repository's issue #8991, auto-mode probe fixtures naming this repository, and observability links into a private provisioning repository. This change removes those values. The plugin's defaults are now neutral, and each value a consumer could set differently is configurable. This repository keeps its own behavior through docs/conventions/harness-ops.yaml.

Fix

  • Data id. parser_reader.py, registry_manager.py and driver.mjs now name their fallback data directory after the marketplace in their own install path. Claude Code derives the name the same way: plugins/cache/<marketplace>/harness-ops/<version> becomes harness-ops-<marketplace>, with non-[A-Za-z0-9_-] characters replaced by -. Outside the plugin cache the name is harness-ops-inline, which Claude Code uses for a --plugin-dir session (docs/extensibility-contract-smoke-tests.md, "A --plugin-dir plugin reads pluginConfigs["<name>@inline"]").
    • The layout rule is the one lib/plugin-options.mjs resolveInstall reads. driver.mjs keeps its own copy of it because CI copies the control-claude-code skill directory alone to /opt/ccd (maintenance-verify-whole-map.yml), so an import from lib/ would not resolve there.
    • An install from this marketplace still resolves to harness-ops-melodic-software.
    • scripts/session-telemetry-state.mjs follows the same rule for the sibling session-telemetry id. It used to fall back to ?? "melodic-software" and now falls back to ?? "inline".
  • probe_state_issue. This is a new userConfig option and a new harness-ops.yaml key. scripts/probe-state-issue.mjs resolves it through the config cascade (lib/config-cascade.mjs, the same way scripts/registry-dir.mjs resolves its key).
    • The resolver reads the option from the operator's settings itself (lib/plugin-options.mjs), so the skill puts no ${user_config.*} token or configured value into any command. It drops a value from any layer that is not shaped <owner>/<repo>#<number>, without echoing it. An empty value or an unrendered placeholder counts as unset.
    • On a live run with no --state-issue, probe.py runs the resolver itself with list arguments and skips the case on an off-shape or unresolvable result. An explicit --state-issue of any other shape is refused.
    • A case marked needs_state_issue gets ${PROBE_STATE_REPO} and ${PROBE_STATE_ISSUE} filled into its prompt.md. A live run with no issue configured skips the case. A dry run fills in probe-owner.invalid/probe-repo#1.
    • This repository sets melodic-software/claude-code-plugins#8991 in docs/conventions/harness-ops.yaml.
  • Auto-mode fixtures. custom-soft-deny-non-git-read-runs and soft-deny-without-defaults-keeps-non-git-default now target probe-owner.invalid/probe-repo. A GitHub login cannot contain a dot, and gh api users/probe-owner.invalid returns 404. The . in input_match is escaped.
  • OTEL references. Three new userConfig options: otel_store_reset_doc, otel_collector_config_ref and otel_dashboards_compose_ref. The observability SKILL.md renders them, and the context files name the parts by option instead of linking a private repository.
  • Wording. audit-plugin-landscape now refers to "this plugin's own marketplace" and "adapted copies". The inventory trigger example says "marketplace X".
  • Docs and changelog. The README configuration table, option bullets and generated options block are updated, along with the schema and a changelog fragment.

Verification

  • node --test plugins/harness-ops/skills/control-claude-code/driver/driver.test.mjs plugins/harness-ops/scripts/probe-state-issue.test.mjs: 123 pass, 0 fail. This includes two new data-id tests and five resolver tests: unset, placeholder, option, team beats option, personal beats team, invalid team value.
  • node --test plugins/harness-ops/scripts/session-telemetry-state.test.mjs: 4 pass, 0 fail. The tests now call state() with a cached root under a neutral marketplace, and one new case covers a root outside the cache, which yields session-telemetry@inline. session-telemetry-state.test.sh exits 0.
  • python3 -m unittest results:
    • test_parser_reader.py: 41 run, OK, 9 skipped because the live parser is not installed.
    • test_registry_manager.py: 12 OK.
    • test_probe.py: 101 OK. This includes the dry run of every shipped case and new tests for the state-issue skip, substitution, stand-in and shape refusal.
  • probe.test.sh: exit 0.
  • After the security lane's finding on probe_state_issue: probe-state-issue.test.mjs 6 pass, including a quote-bearing value rejected from the option, team and personal layers; test_probe.py 102 OK, including a fake resolver whose off-shape, non-zero or non-JSON output leaves the issue unset.
  • node scripts/probe-state-issue.mjs --project <this checkout> prints melodic-software/claude-code-plugins#8991, layer team.
  • scripts/check-changelog-fragments.sh --check, scripts/check-skill-portability.sh origin/main and scripts/validate-plugin-contracts.mjs are clean for harness-ops. Ruff check passes on the changed Python files.
  • No live probe was run. The two auto-mode cases now give the classifier different command text, so their live verdicts have not been re-observed. The next live run of the auto-mode area confirms them.

Related

🤖 Generated with Claude Code

kyle-sexton and others added 2 commits November 19, 2026 01:59
… configurable

The inventory parser, control-claude-code driver and known-issues registry
name their fallback data directory from the marketplace in their own
install path (harness-ops-inline outside the plugin cache) instead of a
fixed publisher id.

The cloud-routine probe takes its issue from probe_state_issue
(userConfig or harness-ops.yaml, resolved through the config cascade by
scripts/probe-state-issue.mjs) and is skipped live when unset; this
repository sets its own issue in docs/conventions/harness-ops.yaml. The
auto-mode gh secret cases target probe-owner.invalid/probe-repo. The
observability skill names provisioning documents through three new OTEL
options instead of links to one organization's repository.

Refs: #17208

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…xed fallback

session-telemetry-state.mjs named the sibling plugin
session-telemetry@melodic-software whenever harness-ops ran outside the
plugin cache. It now uses @inline there, the id Claude Code gives a
--plugin-dir session, as the data-id derivation does. The tests call
state() with a cached root under a neutral marketplace and add the
outside-the-cache case.

Refs: #17208

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 19, 2026 07:07
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 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-19T07:11:04.473926Z 686f245 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: 686f2451c4

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

kyle-sexton and others added 2 commits November 19, 2026 02:11
plan-test-lanes.sh failed the PR because the new Node suite had no
sibling .test.sh and no Node package lane holds it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ops runs inline

With harness-ops outside the plugin cache, session-telemetry-state.mjs
named the sibling session-telemetry@inline even when it was installed
from a marketplace, so it read the wrong data directory. Take the
sibling's id from its own installed record first, and fall back to
@inline only when none exists.

The observability skill states its handling of an unset reference as
our decision and points at the upstream user-configuration section
instead of restating how the token renders.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

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

Failed GitHub API calls

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

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 3288167c3542482553e4687d2c47bbdf9966ce2b: read 7 of 7 changed file(s); 0 finding(s), 0 as inline comments.

Security review (incremental, 398cc3b → 3288167): PR #17406

This lane already reviewed an earlier head, so this pass reports only CRITICAL and IMPORTANT findings. I read every hunk of all 7 files in scope. None of them matches a TRUSTED PATHS glob or touches a trust control, merge hold, kill switch, token request, workflow or plugin manifest.

Overall: no security issues found. The push closes a shell-injection surface.

What I checked:

  • behavior-probes/SKILL.md: the injection surface is gone.
    • Before: the skill told the model to run probe-state-issue.mjs --user-value '${user_config.probe_state_issue}'. That pasted an operator-set option into a single-quoted shell argument, so a value containing ' could break out of the quotes.
    • After: that interpolation is removed. The skill now says "never copy a configured value into a command", and the resolver reads the option itself.
    • No guardrail was removed or softened. The only rule that changed went from "probe.py refuses any other shape" to "a non-matching value is dropped, so the case is skipped". The shape check still applies, so nothing that was refused before now gets through.
  • scripts/probe-state-issue.mjs
    • When --user-value is absent, it reads the option through the existing readOperatorOptions, resolveInstall and managedSettingsFiles exports of plugins/harness-ops/lib/plugin-options.mjs. A read error is reported in errors and does not crash the script.
    • It now checks the resolved value from every layer against SHAPE (^[A-Za-z0-9][A-Za-z0-9-]*\/[A-Za-z0-9._-]+#[1-9][0-9]*$). That pattern matches probe.py's STATE_ISSUE with fullmatch.
    • An off-shape value prints as null, and its text is never echoed. The new test checks this for a payload of ';touch x;' from the option, team and personal layers.
    • No new shell or network path was added. The spawnSync calls use argv arrays.
  • probe.py resolved_state_issue
    • It runs the resolver as an argv list (node <resolver> --project <cwd>), with no shell and a 30 s timeout.
    • It accepts the output only when it is a JSON dict whose value passes STATE_ISSUE.fullmatch a second time. Any other result counts as unset, so the case is skipped.
    • It is only called for a live run with no --state-issue that selects a needs_state_issue case.
    • The team-layer value still comes from the project's working tree, as it did at base. The routine target is still picked by the same cascade. The only difference is that the script resolves it instead of the model.
  • README.md, schemas/harness-ops.schema.json: description text only.
  • Tests (probe-state-issue.test.mjs, test_probe.py): they add regression coverage for the injection payload and have no security surface of their own.

Manifest: plugins/harness-ops/.claude-plugin/plugin.json is not in this incremental diff, so this push hits no manifest item.

Spend: none added.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 3288167c3542482553e4687d2c47bbdf9966ce2b: read 7 of 7 changed file(s); 0 finding(s), 0 as inline comments.

Code review (incremental, 398cc3b → 3288167): no blocking findings

I reviewed only the seven files this push changed. This lane already reviewed an earlier head, so this pass reported blocking findings only.

What I checked

  • plugins/harness-ops/scripts/probe-state-issue.mjs
    • Without --user-value, the script now reads the option from the operator's settings through readOperatorOptions(resolveInstall(realpathSync(ROOT)), managedSettingsFiles(), [KEY]). An OptionsError from a broken settings file is caught and added to errors, so it does not crash the script.
    • The resolved value must match SHAPE. That regex is the same as STATE_ISSUE in probe.py (line 93): no leading zero in the number, and a restricted owner and repo charset.
    • An off-shape value prints as null with layer default. The error message names only the layer, never the value, so a value carrying shell metacharacters is never echoed back.
    • An empty value or an unrendered ${user_config.*} placeholder counts as unset and adds no error.
    • A malformed value in a higher layer stops a well-formed one in a lower layer from applying. The new test asserts this, so it is intended.
  • probe-state-issue.test.mjs. The new test covers an injection-shaped value from the option, team and personal layers, plus a leading-zero issue number. It checks for a null value, the default layer, the error text, and that the value never appears in the output.
  • probe.py
    • resolved_state_issue runs the resolver as an argv list (no shell). It handles OS, timeout and JSON errors and checks the shape again.
    • It runs only for a live run with no explicit --state-issue that selects a needs_state_issue case. It runs after state_issue() has validated an explicit flag (line 1297).
  • test_probe.py. The test uses a fake resolver to cover a good value, off-shape and non-string values, a non-zero exit, and non-JSON output. It skips when node is missing.
  • SKILL.md, README.md, harness-ops.schema.json. The SKILL.md step no longer passes '${user_config.probe_state_issue}' into a shell command. The docs now say the resolver drops an off-shape value, which matches the code.

Verification. I ran nothing myself; I could not run the tests in this lane.

Closing issue. The PR context has no closing-issue section, so there were no acceptance criteria to check.

Spend. This push adds no prepaid-credit or subscription spend.

Loosened-check verdict: fail (the default, because the prompt had no loosened_check_verdict: or loosened_check_patterns: line); patterns: 0. The prompt had no loosened_check_decision_record: line, so I did not check the citation requirement. The push loosens nothing: it adds validation and tests.

Verifier dropped 0 of 0 candidates.

kyle-sexton and others added 2 commits November 19, 2026 02:42
The behavior-probes skill single-quoted the probe_state_issue option into
a shell command and had the model copy the resolved value, which a
repository's harness-ops.yaml can set, into the probe.py command line.

- probe-state-issue.mjs reads the option from the operator's settings
  through lib/plugin-options.mjs (--user-value stays as an explicit
  input) and drops any value from any layer not shaped
  <owner>/<repo>#<number>, naming the layer without echoing the value.
- probe.py, on a live run with no --state-issue and a needs_state_issue
  case selected, runs the resolver itself with list arguments; an
  unresolvable or off-shape result leaves the case skipped.
- SKILL.md no longer puts a ${user_config.*} token or a configured
  value in any command.
- Tests: a quote-bearing value is rejected from the option, team and
  personal layers; probe.py uses only a well-shaped resolver result.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The skill check reads a bare scripts/ path as skill-internal.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton

Copy link
Copy Markdown
Member Author

Answering the four free-form string userConfig keys the security lane flagged at the earlier head:

  • probe_state_issue: fixed in 7e2e5b5 and 3288167. The skill no longer puts ${user_config.probe_state_issue} or any resolved value into a shell command.
    • scripts/probe-state-issue.mjs reads the option from the operator's settings through lib/plugin-options.mjs.
    • It drops any value, from the option or from either harness-ops.yaml layer, that does not match <owner>/<repo>#<number>, the same pattern probe.py enforces. The error names the layer and does not echo the value.
    • On a live run with no --state-issue, probe.py runs the resolver itself with list arguments. An off-shape or unresolvable result leaves the case skipped.
    • New tests reject acme/w';touch x;'#1 from the option, team and personal layers, and check that probe.py uses only a well-shaped resolver result.
    • One behavior change: under a --plugin-dir checkout the resolver sees managed settings only, as lib/plugin-options.mjs documents.
  • The three OTEL keys: left as they are. They render only as prose links in the observability skill's operator-setup text. No command, hook, script or workflow reads them, so they have no execution path.

@github-actions

Copy link
Copy Markdown
Contributor

The pr-verify verifier failed head 3288167c3542482553e4687d2c47bbdf9966ce2b. What it wrote, as data:

What it wrote (36 lines)
Summary: This pull request references #17208 with a `Refs:` line rather than closing it, so it can
  deliver only part of the issue. Its body has to name both the part it delivers and the work left
  for later. It names the delivered part: the harness-ops plugin's organization-specific values. It
  names nothing that remains, and that alone requires `fail`.

The issue still has open work outside this diff:
- classifying every match;
- the source-control, work-items and review cases, including the `babysit_merge_policy.py` decision
  link;
- the CI portability check that fails on a new organization dependency.

The harness-ops change itself looks correct and is in scope:
- The data-directory id now comes from the marketplace in the install path, or `inline` outside the
  plugin cache, in `driver.mjs`, `parser_reader.py`, `registry_manager.py` and
  `session-telemetry-state.mjs`.
- `probe_state_issue` is resolved through the config cascade. Both `probe.py` and
  `probe-state-issue.mjs` check its shape (`<owner>/<repo>#<number>`), and the cloud-routine case is
  skipped on a live run when it is unset.
- The auto-mode test fixtures now target `probe-owner.invalid/probe-repo`.
- The three OTEL options replace the links into the private provisioning repository and are
  documented in the README, the schema and the changelog.

Every pr-require-checks job concluded `success` on the judged head, including Test Python (0), Test
  Node and Test Bash (0)–(3)
  (https://github.com/melodic-software/claude-code-plugins/actions/runs/44482968536/job/135419690473).
  The new tests can fail: they check the shape refusals, the skip and the layer precedence. The diff
  contains no binary files, no credentials, no change to the takeover set, and no text that tries to
  steer a reviewer.
- PR body: under `Refs: #17208`, add a remaining-work section. Name what this pull request leaves to
  later work: classifying every match as runtime behavior, instruction, permitted citation or test
  fixture; the runtime and instruction cases in the other plugins (for example
  `plugins/source-control/skills/babysit-prs/scripts/babysit_merge_policy.py`,
  `plugins/work-items/skills/morning-brief/SKILL.md` and
  `plugins/review/skills/code-review/SKILL.md`); and the CI check
  (`scripts/check-skill-portability.sh` or another) that fails when shipped content adds a new
  organization dependency. Say plainly that this pull request delivers only the harness-ops part.

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 pr-verify-failed pr-verify failed this head; a pass at a new commit, or after a trusted body edit, removes it. and removed pr-verify-failed pr-verify failed this head; a pass at a new commit, or after a trusted body edit, removes it. labels Nov 19, 2026
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit c315a93 Nov 19, 2026
63 checks passed
@kyle-sexton
kyle-sexton deleted the fix/17208-harness-ops-org-agnostic branch November 19, 2026 08:47
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 19, 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.

1 participant