Skip to content

fix(guardrails): OC-D1 stale dynamic-path test now asserts allowed (accepted C15 limitation) - #41371

Closed
terisuke wants to merge 200 commits into
anomalyco:devfrom
Cor-Incorporated:fix/oc-d1-stale-dynamic-path-test
Closed

fix(guardrails): OC-D1 stale dynamic-path test now asserts allowed (accepted C15 limitation)#41371
terisuke wants to merge 200 commits into
anomalyco:devfrom
Cor-Incorporated:fix/oc-d1-stale-dynamic-path-test

Conversation

@terisuke

@terisuke terisuke commented Aug 9, 2026

Copy link
Copy Markdown

概要

opencode #302 の是正。D2 修正(#298)後に旧挙動(無条件 block)を期待したままのテストが dev で赤になっていた。

変更

  • packages/opencode/test/plugin/guardrail-access.test.ts:207 — 動的組み立てパス(.open+code/guard+rails/...)を「block される」から「allow(受容)」に改訂
  • コメントで設計根拠を明記: 表面形検知では原理的に閉じない(C15: シェルの表現力 > 検知空間)。根本保証はファイルシステム側(guardrail.ts の mark/seen 経路限定)に置く — rollout/opencode.md §3 D2 参照
  • 直接パス言及(cmd.includes(".opencode/guardrails"))の block テストは既存テストが維持

検証(反証実証)

  • 改訂前: 同 3 ファイルで 31 pass / 1 fail(本テストが RED — 旧期待が新コードと矛盾することを実測)
  • 改訂後: 32 pass / 0 fail(81 expect calls)
  • コマンド: bun test test/plugin/guardrail-access.test.ts test/plugin/guardrail-access-oc-d1.test.ts test/plugin/guardrail-git.test.ts

Closes #302

terisuke added 30 commits April 19, 2026 17:35
…l-pr

fix: sync upstream guardrail runtime and tests
…l-runtime-fixes

fix: sign macOS builds and harden team runtime
…owups

fix: harden runtime path and team diagnostics
…e-hardening

[codex] Fix team worker absolute path isolation
…60421

Sync upstream dev and fix ESM bin wrapper
…patch-fix

[codex] fix team isolated worktree setup
…deadlock

fix(team): prevent default limit and worker recursion deadlocks
* fix team worker model routing

* update guardrail model defaults

* fix team worker permission propagation
…light-abort

[codex] Fix team run preflight aborts
…ew-guardrail

[codex] Fix external review guardrail detection
terisuke and others added 24 commits August 1, 2026 22:48
Add deepseek to enabled_providers and provider whitelist (v4 flash/pro, chat, reasoner). Keep free-tier paid map and tier recommendations in sync so connect UI can search and use DeepSeek natively.
feat(guardrails): admit native deepseek provider
docs(specs): guardrails ADR — agent-spanning anti-patterns as OpenCode mechanism
ADR / Issue #284 に沿い、削除影響・並列権限・衛生警告・軽量計画/
環境確認・スキル・CI層化を仕組みとして追加する。各ガードに反証と
過剰制限しない陰性テストを同梱する。

Closes #284

Co-authored-by: Cursor <cursoragent@cursor.com>
feat(guardrails): アンチパターン10件のガードを実装
600s ハードリミットで busy worker が強制終了していた問題(Issue #286)
に対し、write/deepseek のデフォルトを 20 分へ引き上げ、provider 別
上書きとタイムアウト時の進捗表示・env 発見性を追加する。

Closes #286

Co-authored-by: Cursor <cursoragent@cursor.com>
feat(team): deepseek実装タスク向けidleタイムアウトを延長
migration/初期schema・version pin・OpenAPI など、同一最終状態に
一致すべき片側だけの更新を助言する。ハードブロックはせず(I)、
/ssot-check・ssot-sync skill・pin 結線テストで PR 前に検出する。

Closes #288

Co-authored-by: Cursor <cursoragent@cursor.com>
feat(guardrails): パターンKのSSOT同期ドリフトガードを追加
SKIP黙認・worktree未準備・ハーネスAPI制限・env密閉不足を、助言
plugin / command / skill / 結線ヘルパーで検出する。ハードブロック
はせず(I)、反証と陰性/陽性テストを同梱する。

Closes #290

Co-authored-by: Cursor <cursoragent@cursor.com>
feat(guardrails): パターンL–Oのテスト検証信頼性ガードを追加
#292)

The default primary agent (implement) declared "gh pr merge *": "deny" in its
frontmatter. agent.ts merges a user-defined agent's permission AFTER the user
config and Permission.evaluate is last-wins, so the deny overrode the explicit
"gh pr merge *": "allow" in opencode.json — silently blocking the main session
from merging despite the config granting it (pattern I over-restriction).

Remove the only primary-agent deny that contradicts a config allow. Specialized
primary agents (planner) keep their intentional read-only denies. Add real-file
regression tests (the prior mirror fixture missed this because it evaluated
implement.md in isolation, not the merged effective ruleset): the effective
permission now allows gh pr merge, the falsifiable deny case still blocks,
destructive denies (rm -rf / force-push / reset --hard) still hold, and planner
may still self-restrict.
fix(guardrails): stop primary agent deny overriding config merge allow
…toctou-permission

fix(guardrails): path-aware secrets, toctou write-through, permission scope, block ledger
docs: OC-D5 re-land on dev (was only on fix-merge-perm-leak)
feat(guardrails): OC-D7 hygiene ignore streak auto-issue
…ccepted C15 limitation)

- #298 の D2 修正(条件結合)後も旧挙動(無条件 block)を期待していたテストを改訂
- 動的組み立てパスは表面形検知では閉じないため受容(rollout/opencode.md §3 D2)
- 検証: guardrail-access + oc-d1 + git テスト 32/32 PASS(旧テストは新コードで RED を実測)

Closes #302
@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Aug 9, 2026
@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@terisuke

terisuke commented Aug 9, 2026

Copy link
Copy Markdown
Author

誤って作成されたクロスフォークPR — 正しいターゲットは Cor-Incorporated/opencode の dev です。

@terisuke terisuke closed this Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs:compliance This means the issue will auto-close after 2 hours.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@<file>: fuzzy find a file and add to context

1 participant