Repository navigation
Skip the lane name guard for profile-only launches #135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
275c0be
fix: skip the lane name guard for profile-only launches
brettheap 64799e1
docs: reconcile the guard recovery contract with profile-only launches
brettheap e968c75
fix: exempt profile-only prompts before lane identity initialization
brettheap 7068eb4
docs: keep the guard contract within the instruction size limit
brettheap 64f4e93
ci: verify the guard launch contract with the canonical focused suite
brettheap a2861bb
docs: record the expanded canonical guard verification
brettheap File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| schema: spec-driven | ||
| created: 2026-09-30 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| ## Context | ||
|
|
||
| See proposal.md. workBenches selects profile and lane modes per launch; profile settings can be used concurrently by both modes. | ||
|
|
||
| ## Goals / Non-Goals | ||
|
|
||
| Honor the process's no-lane marker without editing shared profile settings. Other lane checks and commands retain their existing behavior. | ||
|
|
||
| ## Decisions | ||
|
|
||
| The `guard` handler exits silently with status 0 for the exact environment value `CLAUDE_NO_LANE=1`, before reading hook input or validating lane identity. All other values use the existing enforcement path. Changing profile settings would affect concurrent lane sessions, so the exemption belongs to the child process environment. | ||
|
|
||
| ## Risks / Trade-offs | ||
|
|
||
| An inherited marker could exempt a later lane launch. workBenches clears it for explicit lane requests and lane handoff; only explicit `--no-lane` wins over those requests. Existing Claude processes keep their launch environment and must be relaunched to change mode. | ||
|
|
||
| ## Migration Plan | ||
|
|
||
| Install the marker-aware guard with the normal openRepoTools installation path and install the matching workBenches launcher. Revert both changes to roll back. Do not edit the pinned workBenches vendor copy directly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| ## Why | ||
|
|
||
| Profile-only Claude launches currently encounter the lane name guard even though the operator chose to work without a lane. The guard must honor that launch mode for the lifetime of the process. | ||
|
|
||
| ## What Changes | ||
|
|
||
| - Skip the prompt guard when the launcher supplies `CLAUDE_NO_LANE=1`. | ||
| - Keep the hook installed and enforce existing checks for every other value. | ||
| - Document the process environment contract with workBenches. | ||
| - Run the expanded guard and repository hygiene checks in a focused CI job using the canonical serialized wrapper. | ||
|
|
||
| ## Capabilities | ||
|
|
||
| ### New Capabilities | ||
|
|
||
| - `profile-only-lane-guard`: per-session exemption for a launch without a lane. | ||
|
|
||
| ### Modified Capabilities | ||
|
|
||
| ## Impact | ||
|
|
||
| `lanes-edit.sh guard`, lane documentation and regression coverage. workBenches supplies the marker. Implementation handoff: `specs/002-skip-no-lane-guard/`. |
43 changes: 43 additions & 0 deletions
43
openspec/changes/skip-no-lane-guard/specs/profile-only-lane-guard/spec.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| ## Purpose | ||
|
|
||
| Allow Claude sessions launched without a lane to submit prompts while lane sessions retain their normal identity checks. | ||
|
|
||
| ## ADDED Requirements | ||
|
|
||
| ### Requirement: Profile-only prompts avoid lane initialization | ||
|
|
||
| The guard SHALL apply the exact launch exemption before probing workspace | ||
| configuration, git, workstation identity or its own command path. | ||
|
|
||
| #### Scenario: Infrastructure probes are unavailable | ||
|
|
||
| - **WHEN** a marked guard invocation would encounter unavailable identity commands | ||
| - **THEN** it exits silently with status 0 without invoking those commands | ||
|
|
||
| #### Scenario: Invalid guard arguments accompany the marker | ||
|
|
||
| - **WHEN** a marked guard invocation includes unexpected arguments | ||
| - **THEN** it prints usage and returns status 2 without identity probes | ||
|
|
||
| ### Requirement: Respect the session launch mode | ||
|
|
||
| The prompt guard SHALL silently return status 0 when `CLAUDE_NO_LANE=1`, including when lane identity cannot be read. It SHALL keep existing enforcement for all other values and SHALL NOT alter profile hook settings or lane records for the exempt prompt. | ||
|
|
||
| #### Scenario: Profile session inside the projects root | ||
|
|
||
| - **WHEN** a prompt arrives from a process launched with `CLAUDE_NO_LANE=1` inside the projects root | ||
| - **THEN** it is allowed without consulting tmux or requiring a lane row | ||
|
|
||
| #### Scenario: Unsupported marker value | ||
|
|
||
| - **WHEN** the marker is absent, empty, `0`, or `true` and no lane workspace can be read | ||
| - **THEN** the guard returns status 2 through its existing refusal path | ||
|
|
||
| ### Requirement: Limit the exemption to the prompt guard | ||
|
|
||
| Other lane commands SHALL retain their existing validation even when `CLAUDE_NO_LANE=1` is present. | ||
|
|
||
| #### Scenario: Registry read with no workspace | ||
|
|
||
| - **WHEN** a registry read runs with `CLAUDE_NO_LANE=1` and no workspace configuration | ||
| - **THEN** it still refuses the missing workspace |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| ## 1. Speckit handoff | ||
|
|
||
| - [x] 1.1 Record the authorized behavior and hand off implementation to `specs/002-skip-no-lane-guard/tasks.md`; verify the spec, plan and task files exist. | ||
|
|
||
| Implementation tracking is owned by that Speckit task file. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # Implementation Plan | ||
|
|
||
| Governance: `openspec/changes/skip-no-lane-guard/`. | ||
|
|
||
| Add an exact-value early exit before script initialization using Bash 3.2 syntax, preserving global option parsing and status-2 argument validation. Update the scope documentation and repository contract. Add subprocess regression coverage against isolated home/config directories and sentinels for tmux, git, hostname, readlink and workspace parsing. Verify with `tests/run.sh -k guard_launch_mode`, Bash syntax checks and `openspec validate skip-no-lane-guard --strict`. | ||
|
|
||
| Dependency: workBenches feature `017-export-no-lane-mode` supplies and clears the process marker. Installed estate commands and vendored pins use their existing release paths. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # Feature Specification: Skip the guard for no-lane sessions | ||
|
|
||
| **Feature Branch**: `002-skip-no-lane-guard` | ||
| **Created**: 2026-09-30 | ||
| **Status**: Approved for implementation by the user's request | ||
| **Input**: Implement the agreed per-session no-lane hook exemption. | ||
|
|
||
| ## User Scenarios & Testing | ||
|
|
||
| ### User Story 1 - Work without a lane (Priority: P1) | ||
|
|
||
| A profile session submits prompts even inside a projects directory with no tmux or readable lane workspace. Test the guard with the launch marker and missing lane infrastructure. | ||
|
|
||
| ### User Story 2 - Keep lane enforcement (Priority: P1) | ||
|
|
||
| A lane session must still satisfy the existing identity checks. Test absent and unsupported marker values against the same missing-workspace fixture and expect status 2. | ||
|
|
||
| ## Requirements | ||
|
|
||
| - **FR-001**: Exact `CLAUDE_NO_LANE=1` bypasses only the prompt guard, silently and before reading hook input. | ||
| - **FR-002**: Absent or unsupported values retain the existing checks. | ||
| - **FR-003**: Exempt prompts cause no lane record or tmux mutation. | ||
| - **FR-004**: Keep shared profile hooks installed. | ||
| - **FR-005**: Marked guard invocations avoid workspace, git, workstation and command-path probes, including when global flags are present; invalid guard arguments still return status 2. | ||
|
|
||
| ## Success Criteria | ||
|
|
||
| - Exempt prompt fixtures return status 0 with empty stdout and stderr. | ||
| - Non-exempt fixtures refuse unreadable lane identity with status 2. | ||
| - Other lane commands still refuse missing workspace configuration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # Tasks | ||
|
|
||
| - [x] T001 Add the guard exemption and document its scope. | ||
| - [x] T002 Add regression cases for exact marker handling, unreadable identity and unaffected non-guard commands. | ||
| - [x] T003 Run focused tests, syntax checks and governance validation; record results. | ||
|
|
||
| ## Verification | ||
|
|
||
| - The canonical focused CI command `bash tests/run.sh -k 'guard_launch_mode or repo_hygiene'` passed 165 checks, with 528 deselected, on implementation commit `64f4e93`. This includes all 13 expanded launch-mode cases and proves marked prompts do not invoke identity probes. | ||
| - The launcher/guard end-to-end smoke check passed: a profile-only launch exports the marker and permits its prompt, while an unmarked guard still refuses unreadable identity with status 2. | ||
| - Changed shell files pass `bash -n`; diff whitespace checks and strict OpenSpec validation pass. | ||
| - Windows checks and macOS Bash 3.2 syntax parsing passed. The focused CI runner honors the same wrapper and serialization rules as local runs. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.