Skip to content

fix(harness-ops): refuse a lane that arms the stop gate under a profile without autonomy - #16586

Merged
kyle-sexton merged 2 commits into
mainfrom
fix/16562-lane-stop-gate-profile
Nov 16, 2026
Merged

kyle-sexton merged 2 commits into
mainfrom
fix/16562-lane-stop-gate-profile

Conversation

@kyle-sexton

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

Copy link
Copy Markdown
Member

Closes #16562

Summary

Since #16523 a lane can name a plugin profile, and the profile wins on enabledPlugins in the merged session settings. A lane that armed the autonomy lane-stop gate under a profile leaving autonomy off started without its gate, with no warning. The launcher now refuses that lane.

Fix

  • plugins/harness-ops/skills/lanes/scripts/lane-launcher.sh, lane_claude_prefix: when the lane's settings arm the lane-stop gate, it reads the enabledPlugins that profiles.mjs launch --json reports and refuses the lane unless an autonomy (or autonomy@<marketplace>) entry there is true. The error reads: "lane '': the lane arms the lane-stop gate but profile '' leaves autonomy off and no settings layer enables it for the session, so the lane is not launched; give the lane a profile that includes autonomy". When launch --json reports no enabledPlugins (a plugin-profiles older than this change), the lane is refused with "lane '': profiles.mjs launch reported no enabledPlugins to check the lane-stop gate's autonomy against, so the lane is not launched; update plugin-profiles". The launch (build_lane_flags) and the restart preflight both call this function; the preflight now passes the lane's settings so its check sees the gate, and a refused restart leaves the running lane up.
  • plugins/plugin-profiles/scripts/profiles.mjs, launch: with a profile, the --json result carries enabledPlugins, each plugin any settings layer names as the session will start with it: the existing effective() over the loaded managed, project, local and user layers with the session file as the session layer. A profile writes no entry for a plugin the repository's .claude/settings.json enables, a managed pin, or a plugin of a marketplace it does not govern, so the session file alone would miss those. Reported under --dry-run too (the restart preflight runs --dry-run, which writes no file).
  • plugins/harness-ops/skills/lanes/context/config.md: the lanes[].profile row states both refusals.
  • Changelog fragments: harness-ops patch (fix), plugin-profiles minor (new enabledPlugins field in launch --json).

Done-when, item by item:

  1. A gated launch checks what the merged session settings start it with and, with autonomy not enabled there, is not launched; the error names the lane, the profile and the fix. Delivered: the check reads the session file as the session layer over every other settings layer, so autonomy enabled at project, managed or user level counts, and the error says the profile leaves it off only when no layer enables it.
  2. The check sits in lane_claude_prefix, which build_lane_flags (every launch path) and the restart preflight call. Delivered.
  3. A lane with no stop gate, or with no profile, launches as today: the check runs only when the lane's settings request the gate, and lane_claude_prefix returns before any check with no profile. Delivered; the existing no-profile and no-settings tests still pass.
  4. Tests: gate with autonomy on (launches), gate with autonomy enabled only at project level (launches), gate under a profile without autonomy (refused, on start and on restart), no gate under that profile (launches), and a profiles.mjs reporting no enabledPlugins (gated lane refused with the update error, ungated lane launches). Delivered.

Verification

  • bash plugins/harness-ops/skills/lanes/scripts/lane-launcher.test.sh: PASS, 565 cases, including the new ones listed in item 4. The restart expectation shows the preflight's --with <settings> --dry-run call.
  • node --test --test-concurrency=4 plugins/plugin-profiles/scripts/profiles.test.mjs: 83 pass, 0 fail. The new case launches build in a fixture whose project .claude/settings.json enables toolchain: the session file has no toolchain entry, enabledPlugins reports it true, reports the profile's own false for songwriting over user settings' true, and matches under --dry-run.
  • Pre-push check-affected passes.
  • A refused start (not restart) has already armed the gate and, in a real launch, written the session file before the check; neither is used, and the session file is removed by the 30-day sweep. A refused restart writes neither, since its preflight runs --dry-run before arming.

Related

🤖 Generated with Claude Code

https://claude.ai/code/session_015XWwmbLtFcfditeagftLrv

…le without autonomy

A lane's profile wins on enabledPlugins in the merged session settings,
so a lane arming the autonomy lane-stop gate under a profile that leaves
autonomy off started without its gate. lane_claude_prefix, which both
the launch and the restart preflight use, now refuses that lane with an
error naming the lane, the profile and the fix. The restart preflight
passes the lane's settings so its check sees the gate.

plugin-profiles' launch --json reports the merged settings it writes
(under --dry-run too), which is what the check reads.

Closes #16562

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015XWwmbLtFcfditeagftLrv
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 16, 2026 17:59
@kyle-sexton

Copy link
Copy Markdown
Member Author

Owner: the control-hub session "Plugin Presets" watches and merges this pull request; it waits on CI Status and the review lanes on head 9bfb5ec. Review findings go to it, and the build session (plugin-profiles-build-5) fixes them.

@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-16T18:06:26.351312Z 9bfb5ec 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.

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review: PR #16586, incremental (9bfb5ec → d62fd5d)

This review was blocking only: this lane already reviewed an earlier head, so it reports only CRITICAL and IMPORTANT findings. I found no security issues in this push. I read all six files listed in the incremental scope.

What changed in this push. profiles.mjs launch --json no longer reports the merged session document as settings. It now reports enabledPlugins: for each plugin that any settings layer names, effective() over the loaded layers, with the session file as the session layer. lane_claude_prefix in lane-launcher.sh reads that field. These two changes fix the two settled threads on the launcher's gate check.

What I checked:

  • The launcher check still refuses when in doubt (lane-launcher.sh#L1587-L1600). A lane that arms the gate is refused in either of two cases: enabledPlugins is not an object (a missing field, an older plugin-profiles, or a jq error), or no autonomy / autonomy@* entry is exactly true. Lanes with no gate or no profile take the same paths as before. Both error strings are fixed text plus the lane and profile names, and they go to stderr.
  • The reported value matches the real precedence (plan.mjs#L27, #L67). PRECEDENCE = ["managed", "session", "local", "project", "user"], so the check honours a managed setting that disables autonomy rather than letting the session file override it. Accepting autonomy enabled at project, local or user level is not a widening: Claude Code loads the plugin from those layers anyway. The arming step and its managed-settings veto are unchanged.
  • The new output exposes less. result.enabledPlugins at profiles.mjs#L444-L446 is a map of plugin id to boolean from settings files the user already has. It replaces the earlier full-document output, which carried the env block. prepare now also returns loaded, which launch uses internally.
  • No trust controls are touched. None of the six files is a workflow, action, merge hold, token request, trusted-actor list or plugin manifest. The config.md row and the changelog fragment are documentation and remove no standing instruction. The test changes only cover the new cases (autonomy enabled only at project level, and no enabledPlugins field).
  • Settled threads: the three resolved threads on lane-launcher.sh (marked lines changed: no) are answered by this push. I raised nothing from them again.

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-review: 2 inline finding(s) on 9bfb5ec9d56d33871a9c8184b7dc6e8460217035; 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 d62fd5d4b4145268658071619ceb5127f15aa590: read 6 of 6 changed file(s); 0 finding(s), 0 as inline comments.

Incremental code review: 9bfb5ec9 → d62fd5d4

No blocking findings in this push. This review covered only blocking findings, because this lane has already reviewed an earlier head (blocking only: yes). I read every hunk of the 6 files listed in .claude-lane/incremental.diff.

Earlier findings: both fixed

The owner resolved both earlier threads with a decision ("VALID (fix now)"), and the code at this head does what those replies describe:

  1. Wrong refusal when the profile writes no autonomy entry.
    • launch --json no longer reports the session file's content as settings. It now reports enabledPlugins: for every plugin any settings layer names, the value effective() gives over { ...p.loaded, session: doc } (profiles.mjs#L444-L446).
    • I checked that this uses the existing layer shapes correctly. readLayers returns {managed, user, project, local}, each with enabledPlugins. entriesOf reads layers[level].enabledPlugins. PRECEDENCE is managed > session > local > project > user (plan.mjs#L27).
    • The result: a managed false still overrides the session, and an autonomy entry from the project, local or user layer counts when the session file has none.
    • prepare now also returns loaded, which it already computed.
  2. Misleading error with an older plugin-profiles. lane_claude_prefix now checks first that .enabledPlugins is an object. When it is not, it refuses the lane with an error that says to update plugin-profiles (lane-launcher.sh#L1587-L1600). Refusing is still the default.

Tests

  • The launcher stub has new project and nofield modes, and there are new cases for each.
  • profiles.test.mjs has a new case: a fixture plugin enabled by the repository settings is reported true though the session file has no entry for it, and --dry-run reports the same map.
  • The removed assertions on merged.settings and ok.settings tested a field that never shipped, so dropping them is correct.

I ran neither test suite. The pass counts in the PR description are the author's claim and I have not checked them.

Changelog and docs

  • The plugin-profiles fragment and the config.md lanes[].profile row now describe enabledPlugins and the second refusal. Both match the code.
  • No plugin.json or marketplace.json changed.

Closing issue #16562

All four Done-when items are still met. The tests now also cover autonomy enabled only at project level, and a profiles.mjs that reports no enabledPlugins.

No embedded instructions in the PR context, settled threads or prior findings.

Verifier dropped 0 of 0 candidates.

@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: 9bfb5ec9d5

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

…start

launch --json now reports enabledPlugins as the session will start with
them, through effective() over every loaded settings layer with the
session file as the session layer, in place of the session file's own
content. A profile writes no entry for a plugin the repository, managed
or user settings enable, so the old check refused a gated lane whose
session would start with autonomy on.

The launcher also refuses, with its own error saying to update
plugin-profiles, when profiles.mjs reports no enabledPlugins, instead of
blaming the profile.

Refs: #16562

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015XWwmbLtFcfditeagftLrv
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 16, 2026
Merged via the queue into main with commit c4a220c Nov 16, 2026
72 checks passed
@kyle-sexton
kyle-sexton deleted the fix/16562-lane-stop-gate-profile branch November 16, 2026 18:22
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 6, survived 1, timeout 0, no coverage 0, invalid 0, not run 0.
Covered-code score 86%; mutation score 86%.

File Killed Survived Timeout No coverage Invalid Not run
plugins/harness-ops/skills/lanes/scripts/lane-launcher.sh 5 1 0 0 0 0
plugins/plugin-profiles/scripts/profiles.mjs 1 0 0 0 0 0

Surviving mutants

Location Operator Disposition Cause
plugins/harness-ops/skills/lanes/scripts/lane-launcher.sh:1593 LCR productive input-gap

The run's summary has the full report.

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.

Refuse a lane launch that arms the stop gate under a profile without autonomy

1 participant