Repository navigation
fix(openspec-propose): enforce dirty-tree guard with AskUserQuestion tool call - #406
Merged
Merged
Conversation
…tool call Replace prose-only dirty-tree guard in openspec-propose skill and opsx-propose command with explicit AskUserQuestion tool-call enforcement. Under context compression, prose-only gates could be silently dropped, causing agents to switch branches with uncommitted work. - Add AskUserQuestion with options: "Stash changes and continue" / "Abort — keep changes as-is" - Add stash failure handling (non-zero exit → abort) - Add post-stash verification (git status must be empty after stash) - Create OpenSpec change artifacts (proposal, design, specs, tasks) - Document 5 remaining files with same vulnerability in design.md Fixes unbound-force#350, unbound-force#353 Assisted-by: claude-opus Generated with AI assistance (claude-opus)
This was referenced Jul 31, 2026
Closed
jflowers
added a commit
that referenced
this pull request
Aug 1, 2026
…cit AskUserQuestion gate Replace the prose-only "STOP and ask the user for confirmation" instruction in speckit-workflow/SKILL.md Pre-conditions section with an explicit AskUserQuestion tool call pattern matching the sibling files hardened in PRs #396 and #406. - Add AskUserQuestion with stash/abort options - Add stash failure handling (non-zero exit → abort) - Add post-stash re-verification via git status --short - Add post-workflow stash restore reminder - Update scaffold copy in lockstep - Add OpenSpec change artifacts Fixes #395 Assisted-by: claude-opus Generated with AI assistance (claude-opus)
sonupreetam
added a commit
to sonupreetam/unbound-force
that referenced
this pull request
Aug 3, 2026
Add a three-layer runtime sandbox for the OpenCode review invocation in council-review-action: Layer 1 — OPENCODE_CONFIG_CONTENT permission config: Denies edit, bash, webfetch, websearch, skill, external_directory, and doom_loop. Read, glob, grep remain allowed (OpenCode defaults). Task is intentionally NOT denied — required for multi-agent Divisor subagent invocation via the Task tool. Layer 2 — --pure flag: External MCP plugins are not loaded, closing the plugin bypass vector where an external plugin could grant capabilities beyond the permission config. Layer 3 — Agent frontmatter: All divisor-*.md agents now declare permission: edit: deny, bash: deny, webfetch: deny in their frontmatter. This is defense-in-depth; even if the runtime config were misconfigured, agent-level restrictions apply. Additional changes: - Bumped opencode pin from 1.2.26 to 1.15.13 (1.16.0+ changed JSONL streaming format, breaking parse-output.sh) - Explicitly deny all ask-default permissions instead of using --dangerously-skip-permissions or --auto - Synced scaffold assets with migrated agent frontmatter - Added OpenSpec artifacts for council-review-sandbox References: nunya#406, unbound-force#337 (closed as NOT_PLANNED — work folded into unbound-force#406) Signed-off-by: sonupreetam <[email protected]>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Closes the T1 (prose-only gate) vulnerability in the
openspec-proposeskill andopsx-proposecommand identified in issues #350 and #353.Both files had a dirty-tree guard before
git checkout -bthat described "asking theuser for confirmation" in prose only. Under context compression (long sessions, large
tool outputs), this prose reasoning could be dropped by the agent, causing silent branch
switches with uncommitted work — a data integrity risk.
The fix replaces the prose-only guard with an explicit
AskUserQuestiontool-callinstruction that cannot be optimized away. The guard now requires:
git statusoutput, target branch, and a warningFixes #350, #353
How to Test
/opsx-proposesession with a dirty working tree (uncommitted changes).Verify the agent invokes AskUserQuestion with two options instead of silently
switching branches.
git stashruns and the tree is verified clean before checkout.("Dirty working tree check"), after
git status --shortand beforegit checkout -b.How to Demo
Open
.opencode/skills/openspec-propose/SKILL.mdand navigate to the "Dirty workingtree check" subsection. The prose-only "ask the user" language has been replaced with
an explicit AskUserQuestion tool-call block specifying options, stash handling, and
verification. The same change is mirrored in
.opencode/commands/opsx-propose.md.Key Files Changed
Implementation:
.opencode/skills/openspec-propose/SKILL.md(+23 lines) — AskUserQuestion enforcement added to dirty-tree guard.opencode/commands/opsx-propose.md(+20 lines) — identical fix in companion commandOpenSpec artifacts:
openspec/changes/fix-dirty-tree-guard/proposal.md— change proposal with constitution alignmentopenspec/changes/fix-dirty-tree-guard/design.md— technical design with known remaining instancesopenspec/changes/fix-dirty-tree-guard/specs/dirty-tree-guard-enforcement.md— delta spec (FR-001, FR-002)openspec/changes/fix-dirty-tree-guard/tasks.md— implementation checklist (all tasks complete)This PR was generated by /finale (AI-assisted).