Skip to content

feat: expand Everyday semantic coverage (EVM-201–300) - #2677

Open
kantorcodes wants to merge 32 commits into
release/3.0from
feat/everyday-mode-201-300
Open

feat: expand Everyday semantic coverage (EVM-201–300)#2677
kantorcodes wants to merge 32 commits into
release/3.0from
feat/everyday-mode-201-300

Conversation

@kantorcodes

Copy link
Copy Markdown
Member

Implements EVM-201 through EVM-300 on release/3.0: permissions, disk/power, process/service, Git local/remote, network download and download+execute, secret access/exfiltration, package install/scripts, and container semantics. Presentation remains display-only and does not alter enforcement, policy, approvals, receipts, retention, or entitlements. All review comments and Core CI must pass before merge.

kantorcodes and others added 30 commits August 25, 2026 19:11
@qodo-code-review

Copy link
Copy Markdown

ⓘ Your Qodo trial ends soon. Ask your workspace admin to set up billing to keep reviews running after the trial. Manage billing

@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (2)
  • release/2.2
  • release/3.1

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Team

Run ID: 889c9f83-af14-4c77-96a3-ffccfa28294f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@qodo-code-review

qodo-code-review Bot commented Aug 30, 2026

Copy link
Copy Markdown

PR Summary by Qodo

Expand deterministic Everyday action semantics for EVM-201–300

✨ Enhancement 🧪 Tests 📝 Documentation ⚙️ Configuration changes 🕐 40+ Minutes

Grey Divider

AI Description

• Adds deterministic Core semantics for destructive, network, package, secret, Git, and container
 actions.
• Renders identity-bound explanations through Core-backed Everyday and Technical presentation modes.
• Enforces redaction, retention, and metadata boundaries with adversarial Python and dashboard
 tests.
Diagram

graph TD
  A["Canonical action"] --> B["Fact builder"] --> C["Semantic rules"] --> D["Explanation contract"] --> E["Action renderer"]
  F["Core settings"] --> G["Mode provider"] --> E
  H["Extension metadata"] --> C
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Interpret commands in the dashboard
  • ➕ Could tailor explanations directly to each UI surface.
  • ➕ Avoids transporting a richer explanation contract.
  • ➖ Duplicates security-sensitive parsing outside Core.
  • ➖ Can diverge across surfaces and expose raw command details.
  • ➖ Weakens canonical identity and deterministic rendering guarantees.
2. Embed metadata in enforcement extensions
  • ➕ Keeps command rule and explanation metadata in one registry.
  • ➕ May simplify coverage discovery.
  • ➖ Couples presentation changes to enforcement authority.
  • ➖ Increases the risk that external metadata influences policy decisions.
  • ➖ Makes independent schema revision and rollback controls harder.

Recommendation: Keep the PR's Core-owned deterministic builder and separate presentation-only extension metadata schema. This preserves one authoritative semantic interpretation, explicit identity and retention boundaries, and a UI that only controls disclosure; the alternatives introduce semantic drift or blur enforcement authority.

Files changed (23) +2695 / -1

Enhancement (6) +1808 / -1
action-explanation.tsxRender shared Everyday action explanations +189/-0

Render shared Everyday action explanations

• Adds reusable React components for localized text, targets, consequences, confidence notices, safer alternatives, identity mismatch alerts, and exact-action disclosure. Technical details remain gated by availability and presentation-mode disclosure state.

dashboard/src/action-explanation.tsx

main.tsxMount the presentation mode authority +4/-1

Mount the presentation mode authority

• Wraps the dashboard application in PresentationModeProvider so all explanation surfaces share the Core-backed mode state.

dashboard/src/main.tsx

presentation-mode-provider.tsxProvide Core-backed presentation mode state +162/-0

Provide Core-backed presentation mode state

• Adds a context provider that validates Core presentation metadata, preserves authoritative source information, supports session previews, handles read failures, and persists mode changes with revision checks.

dashboard/src/presentation-mode-provider.tsx

action_explanation_builder.pyBuild identity-bound explanations from typed actions +433/-0

Build identity-bound explanations from typed actions

• Introduces a bounded semantic-fact model and deterministic builder for single and compound canonical commands. It separates action meaning from policy context, controls exact details by retention and authorization, redacts technical projections, and provides stable cache and identity checks.

src/codex_plugin_scanner/guard/runtime/action_explanation_builder.py

command_extension_explanations.pyValidate presentation-only extension metadata +261/-0

Validate presentation-only extension metadata

• Adds typed extension and rule metadata parsing with deterministic digests, schema and rollback protection, bounded redaction, recursive enforcement-field rejection, uniqueness checks, and built-in coverage validation.

src/codex_plugin_scanner/guard/runtime/command_extension_explanations.py

semantic_explanations.pyAdd the deterministic Everyday semantic catalog +759/-0

Add the deterministic Everyday semantic catalog

• Adds local, side-effect-free semantic matching and safe target extraction for filesystem, permission, credential, network, transfer, and package actions, with limited-confidence fallback. Explanations carry consequences, safer alternatives, identity digests, and retention-aware redacted technical details; branch automation extends the catalog for EVM-201–300 families.

src/codex_plugin_scanner/guard/runtime/semantic_explanations.py

Tests (4) +657 / -0
action-explanation.test.tsxVerify explanation disclosure and identity behavior +129/-0

Verify explanation disclosure and identity behavior

• Tests equivalent explanation content across Everyday and Technical modes, disclosure defaults, action identity mismatch warnings, and unavailable retained-detail messaging.

dashboard/src/action-explanation.test.tsx

test_guard_action_explanation_builder.pyTest typed builder identity and privacy contracts +176/-0

Test typed builder identity and privacy contracts

• Covers canonical identity preservation, policy-independent semantics, ordered compound actions, retention and authorization gates, bounded typed facts, flag handling, cache inputs, and fail-closed identity matching.

tests/test_guard_action_explanation_builder.py

test_guard_command_extension_explanations.pyTest extension metadata authority boundaries +108/-0

Test extension metadata authority boundaries

• Verifies stable parsing and digests, schema and rollback rejection, enforcement-field exclusion, mandatory consequences, redaction and bounds, and explicit built-in fallback coverage.

tests/test_guard_command_extension_explanations.py

test_guard_semantic_explanations.pyExercise semantic explanations adversarially +244/-0

Exercise semantic explanations adversarially

• Covers supported command families across dialects, unknown fallback, credential false positives, curl flag handling, secret redaction, typed-target precedence, exact-detail authorization, Windows option parsing, digest stability, and side-effect freedom.

tests/test_guard_semantic_explanations.py

Documentation (4) +74 / -0
action-explanation-runtime.mdDocument explanation identity, retention, and deletion +25/-0

Document explanation identity, retention, and deletion

• Defines the deterministic Core build boundary, semantic-fact separation, identity and cache requirements, safe projections, authorization gates, redaction behavior, and retention/deletion contract.

docs/guard/everyday-mode/action-explanation-runtime.md

extension-explanation-metadata.mdDocument extension presentation metadata boundaries +21/-0

Document extension presentation metadata boundaries

• Describes allowed extension explanation fields, revision and schema checks, recursive rejection of enforcement fields, coverage requirements, and deterministic digest binding.

docs/guard/everyday-mode/extension-explanation-metadata.md

semantic-coverage-201-300.mdDocument EVM-201–300 semantic coverage +5/-0

Document EVM-201–300 semantic coverage

• Summarizes the newly covered action families and the requirements for canonical facts, safe targets, consequences, safer alternatives, fallback confidence, redaction, and cross-mode contract parity.

docs/guard/everyday-mode/semantic-coverage-201-300.md

semantic-explanation-catalog.mdDefine the deterministic semantic catalog contract +23/-0

Define the deterministic semantic catalog contract

• Documents catalog ownership, covered action families, compound and unknown behavior, compatibility identities, privacy projections, retention controls, and extension metadata constraints.

docs/guard/everyday-mode/semantic-explanation-catalog.md

Other (9) +156 / -0
everyday-mode-implement-201-300.ymlAutomate EVM-201–300 implementation and validation +122/-0

Automate EVM-201–300 implementation and validation

• Adds a branch-scoped workflow that injects the expanded system, process, Git, package-script, container, and download-and-execute semantics, creates focused tests and documentation, runs Core and dashboard validation, removes scaffolding, and pushes the generated commit. Actions and tool versions are pinned, and bot recursion is prevented.

.github/workflows/everyday-mode-implement-201-300.yml

everyday-mode-source-export-201-300.ymlExport short-lived branch source archives +27/-0

Export short-lived branch source archives

• Adds a read-only workflow that archives the EVM-201–300 branch source and uploads it as a one-day artifact for review or external validation.

.github/workflows/everyday-mode-source-export-201-300.yml

.batch-101-200-review-fixesRecord prior semantic review corrections +1/-0

Record prior semantic review corrections

• Marks verification of curl upload classification and canonical operand regression fixes from the preceding semantic batch.

docs/guard/everyday-mode/.batch-101-200-review-fixes

.batch-201-300-baseMark the EVM-201–300 stack base +1/-0

Mark the EVM-201–300 stack base

• Adds temporary batch scaffolding used by the branch implementation workflow.

docs/guard/everyday-mode/.batch-201-300-base

.branch-201-300Mark the temporary implementation branch +1/-0

Mark the temporary implementation branch

• Adds a temporary branch marker consumed and later removed by implementation automation.

docs/guard/everyday-mode/.branch-201-300

.branch-201-300-readyMark the EVM branch as ready +1/-0

Mark the EVM branch as ready

• Adds temporary readiness scaffolding for the stacked implementation process.

docs/guard/everyday-mode/.branch-201-300-ready

.e201Mark the EVM-201 stack point +1/-0

Mark the EVM-201 stack point

• Adds a temporary stack marker for the EVM-201–300 automation sequence.

docs/guard/everyday-mode/.e201

.final-stack-pointMark the final implementation stack point +1/-0

Mark the final implementation stack point

• Adds temporary final-stack scaffolding that the implementation workflow removes before committing generated changes.

docs/guard/everyday-mode/.final-stack-point

.stack-markerTrack stacked implementation state +1/-0

Track stacked implementation state

• Adds a temporary marker identifying the stacked Everyday Mode implementation branch.

docs/guard/everyday-mode/.stack-marker

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (14) 📘 Rule violations (1) 📜 Skill insights (0)

Grey Divider


Action required

1. Python contract module missing 🐞 Bug ≡ Correctness
Description
Both new runtime modules import action_explanation_contract, but that module is absent from the PR
branch, so importing either module raises ModuleNotFoundError and the workflow's pytest validation
cannot run. This prevents all new Core explanation functionality from loading.
Code

src/codex_plugin_scanner/guard/runtime/action_explanation_builder.py[R18-23]

+from .action_explanation_contract import (
+    ACTION_EXPLANATION_REDACTION_VERSION,
+    ACTION_EXPLANATION_RENDERER_VERSION,
+    GuardActionExplanationV1,
+    parse_action_explanation,
+)
Relevance

●●● Strong

Import-time missing dependencies are treated as correctness blockers; similar runtime import
failures were accepted.

PR-#237

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The builder and semantic catalog both unconditionally import the missing module and depend on its
types/constants throughout their public entry points; the workflow explicitly imports these modules
during pytest.

src/codex_plugin_scanner/guard/runtime/action_explanation_builder.py[18-29]
src/codex_plugin_scanner/guard/runtime/semantic_explanations.py[19-27]
.github/workflows/everyday-mode-implement-201-300.yml[93-98]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new explanation runtime imports a contract module that is not present, so tests and runtime imports fail.

## Issue Context
Provide the contract classes, constants, parser, and action-kind definitions consumed by both new runtime modules.

## Fix Focus Areas
- src/codex_plugin_scanner/guard/runtime/action_explanation_builder.py[18-23]
- src/codex_plugin_scanner/guard/runtime/semantic_explanations.py[19-27]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Disk commands become power changes 🐞 Bug ≡ Correctness
Description
The generated disk rule requires an argument token such as format or mkfs, even though those
values are normally the executable, and the following tokenless power rule uses the same executable
set. As a result, commands such as mkfs /dev/sda and format C: miss the disk rule and are
confidently described as changing the computer's power state.
Code

.github/workflows/everyday-mode-implement-201-300.yml[41]

+          rules = '''    SemanticRule(\n        rule_id="system.disk_destructive",\n        action_kind="disk_change",\n        executables=_SYSTEM_EXECUTABLES,\n        required_tokens=(frozenset({"format", "clean", "create", "delete", "mkfs", "--all", "/q"}),),\n        headline="Erase or reconfigure a storage drive",\n        summary="{actor} wants to make a destructive storage change involving {target}.",\n        impact="Files on the affected drive or partition can be permanently lost and the system may become unusable.",\n        recommendation="Confirm the exact drive or partition and make sure required data is backed up.",\n        target_strategy="system",\n        confidence="derived",\n        consequence_level="critical",\n        safer_alternatives=(("preview", "List the exact drive or partition first."), ("backup", "Back up important data before changing storage.")),\n    ),\n    SemanticRule(\n        rule_id="system.power",\n        action_kind="system_change",\n        executables=_SYSTEM_EXECUTABLES,\n        headline="Change this computer's power state",\n        summary="{actor} wants to shut down, restart, halt, or otherwise change {target}.",\n        impact="Running work can be interrupted and unsaved changes may be lost.",\n        recommendation="Confirm that stopping or restarting this computer is expected.",\n        target_strategy="system",\n        confidence="derived",\n        consequence_level="high",\n        safer_alternatives=(("review", "Save active work and confirm the host first."),),\n    ),\n    SemanticRule(\n        rule_id="process.service",\n        action_kind="process_stop",\n        executables=_PROCESS_EXECUTABLES,\n        headline="Stop or change a running process or service",\n        summary="{actor} wants to control {target}.",\n        impact="Applications, background services, or recurring jobs may stop working or become unavailable.",\n        recommendation="Confirm the exact process, service, or job and use the narrowest action.",\n        target_strategy="process",\n        confidence="derived",\n        consequence_level="high",\n        safer_alternatives=(("preview", "Identify the exact running process or service first."), ("narrow", "Target only the intended process or service.")),\n    ),\n    SemanticRule(\n        rule_id="git.remote_rewrite",\n        action_kind="git_remote_change",\n        executables=_GIT_EXECUTABLES,\n        required_tokens=(frozenset({"push"}), frozenset({"--force", "-f", "--force-with-lease", "--delete"})),\n        headline="Rewrite or delete shared Git history",\n        summary="{actor} wants to change shared repository history involving {target}.",\n        impact="Other collaborators can lose commits or need to repair their local branches.",\n        recommendation="Review the remote and branch, preserve a backup ref, and prefer force-with-lease when rewriting is intentional.",\n        target_strategy="git",\n        confidence="exact",\n        consequence_level="high",\n        safer_alternatives=(("backup", "Create a backup branch or tag first."), ("narrow", "Prefer force-with-lease over an unconditional force push.")),\n    ),\n    SemanticRule(\n        rule_id="git.remote_change",\n        action_kind="git_remote_change",\n        executables=_GIT_EXECUTABLES,\n        required_tokens=(frozenset({"remote", "push", "fetch"}), frozenset({"set-url", "remove", "rename", "--delete"})),\n        headline="Change a Git remote or shared reference",\n        summary="{actor} wants to change {target}.",\n        impact="Future pushes, fetches, or shared references can point somewhere different or disappear.",\n        recommendation="Confirm the remote repository and reference before continuing.",\n        target_strategy="git",\n        confidence="derived",\n        consequence_level="high",\n        safer_alternatives=(("preview", "List remotes and references first."),),\n    ),\n    SemanticRule(\n        rule_id="git.local_destructive",\n        action_kind="git_history_rewrite",\n        executables=_GIT_EXECUTABLES,\n        required_tokens=(frozenset({"reset", "clean", "restore", "checkout", "rebase", "branch"}),),\n        headline="Discard or rewrite local Git work",\n        summary="{actor} wants to change local repository history involving {target}.",\n        impact="Uncommitted files, staged work, local commits, or branches can be lost.",\n        recommendation="Inspect the changes first and create a stash or backup branch when anything must be preserved.",\n        target_strategy="git",\n        confidence="derived",\n        consequence_level="high",\n        safer_alternatives=(("preview", "Review Git status and the affected commits first."), ("backup", "Stash changes or create a backup branch.")),\n    ),\n    SemanticRule(\n        rule_id="package.script",\n        action_kind="package_script",\n        executables=_PACKAGE_SCRIPT_EXECUTABLES,\n        required_tokens=(frozenset({"run", "run-script", "exec", "x", "dlx", "postinstall", "prepare", "prepublish", "build"}),),\n        headline="Run a project or package script",\n        summary="{actor} wants to run {target}.",\n        impact="The script can change files, start processes, contact the network, or run code from installed dependencies.",\n        recommendation="Inspect the script definition and run only the narrowest expected target.",\n        target_strategy="package_script",\n        confidence="derived",\n        consequence_level="medium",\n        safer_alternatives=(("preview", "Inspect the script definition before running it."), ("narrow", "Run only the specific expected script.")),\n    ),\n    SemanticRule(\n        rule_id="container.privileged",\n        action_kind="container_change",\n        executables=_CONTAINER_EXECUTABLES,\n        required_tokens=(frozenset({"run", "create"}), frozenset({"--privileged", "--pid=host", "--network=host", "--mount", "-v", "--volume"})),\n        headline="Run a container with broad host access",\n        summary="{actor} wants to run {target} with access that can reach parts of this computer.",\n        impact="The container may be able to read secrets, modify host files, or expose services beyond the container boundary.",\n        recommendation="Use a pinned image, read-only filesystem, and the narrowest mounts and capabilities possible.",\n        target_strategy="container",\n        confidence="derived",\n        consequence_level="high",\n        safer_alternatives=(("isolate", "Use a read-only filesystem and narrow mounts."), ("narrow", "Remove privileged or host-wide access when it is not required.")),\n    ),\n    SemanticRule(\n        rule_id="container.destructive",\n        action_kind="container_change",\n        executables=_CONTAINER_EXECUTABLES,\n        required_tokens=(frozenset({"rm", "prune", "system", "volume", "network"}),),\n        headline="Delete or reconfigure container data",\n        summary="{actor} wants to change {target}.",\n        impact="Containers, images, volumes, networks, or cached data may be removed and may not be recoverable.",\n        recommendation="Preview affected container resources before deleting them.",\n        target_strategy="container",\n        confidence="derived",\n        consequence_level="high",\n        safer_alternatives=(("preview", "List the affected containers, images, volumes, and networks first."),),\n    ),\n    SemanticRule(\n        rule_id="container.change",\n        action_kind="container_change",\n        executables=_CONTAINER_EXECUTABLES,\n        required_tokens=(frozenset({"run", "create", "exec", "start", "stop", "restart", "pull", "build"}),),\n        headline="Run or change a container workload",\n        summary="{actor} wants to change {target}.",\n        impact="Containerized code can change files, processes, networks, and data available to the container.",\n        recommendation="Confirm the image, command, mounts, and network access before continuing.",\n        target_strategy="container",\n        confidence="derived",\n        consequence_level="medium",\n        safer_alternatives=(("narrow", "Use a pinned image and the narrowest permissions."),),\n    ),\n'''
Relevance

●●● Strong

Semantic false-positive and rule-order correctness fixes are consistently accepted when they
misclassify commands.

PR-#225
PR-#398

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The workflow defines one _SYSTEM_EXECUTABLES set containing both disk and power tools. Its disk
rule requires a token group, while its immediately following power rule has no required tokens, and
rule matching selects the first rule whose executable/token conditions pass.

.github/workflows/everyday-mode-implement-201-300.yml[36-41]
src/codex_plugin_scanner/guard/runtime/semantic_explanations.py[114-119]
src/codex_plugin_scanner/guard/runtime/semantic_explanations.py[358-364]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Disk executables fall through to the broad power rule when their arguments lack one of the disk token markers.

## Issue Context
Use distinct executable sets and make destructive disk matching reflect each command's actual grammar.

## Fix Focus Areas
- .github/workflows/everyday-mode-implement-201-300.yml[36-41]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Partial parses appear confident 🐞 Bug ≡ Correctness
Description
When canonical parsing returns only a prefix because the token limit was exceeded, the builder still
classifies that prefix using the rule's normal exact or derived confidence and omits the parser
uncertainty from Everyday output. Users can therefore receive a confident, specific explanation for
a command whose remaining actions were never parsed.
Code

src/codex_plugin_scanner/guard/runtime/semantic_explanations.py[R358-364]

+    executable = _normalize_executable(input.executable)
+    args = tuple(str(arg) for arg in input.arguments)
+    tokens = frozenset(_normalized_tokens(args))
+    rule = next((candidate for candidate in SEMANTIC_RULES if candidate.matches(executable, tokens)), None)
+    if rule and rule.rule_id == "credentials.read" and not _has_sensitive_target(input, args):
+        rule = None
+    match = _render_match(rule, input, executable, args)
Relevance

●●● Strong

Recent reviews accept fail-closed uncertainty fixes when parser ambiguity could hide reachable or
risky behavior.

PR-#2651
PR-#2480

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The parser returns already accumulated segments with confidence="uncertain" on token overflow. The
builder consumes the first retained segment, while explain_command chooses confidence and
uncertainty solely from the semantic rule and exposes parse confidence only as technical metadata.

src/codex_plugin_scanner/guard/runtime/command_model.py[209-228]
src/codex_plugin_scanner/guard/runtime/action_explanation_builder.py[105-113]
src/codex_plugin_scanner/guard/runtime/semantic_explanations.py[358-364]
src/codex_plugin_scanner/guard/runtime/semantic_explanations.py[425-427]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Semantic confidence ignores uncertainty and truncation reported by the canonical parser.

## Issue Context
Downgrade confidence and carry the canonical uncertainty reason whenever parsing is not exact; avoid specific semantics when only a partial prefix is available.

## Fix Focus Areas
- src/codex_plugin_scanner/guard/runtime/action_explanation_builder.py[105-113]
- src/codex_plugin_scanner/guard/runtime/semantic_explanations.py[358-364]
- src/codex_plugin_scanner/guard/runtime/semantic_explanations.py[425-427]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View high (8)
4. Write token reaches branch code 🐞 Bug ⛨ Security
Description
The implementation job persists a contents: write credential while executing repository-controlled
Python, tests, dependency installation, and dashboard scripts from a human-pushable feature branch,
allowing malicious code or dependencies to use or exfiltrate the token and alter repository
contents. The actor condition excludes only github-actions[bot] and does not establish that the
triggering pusher is trusted.
Code

.github/workflows/everyday-mode-implement-201-300.yml[R21-25]

+      - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10
+        with:
+          ref: feat/everyday-mode-201-300
+          fetch-depth: 0
+          persist-credentials: true
Relevance

●●● Strong

Recent workflow security precedents accept reducing credential exposure and hardening token-bearing
jobs.

PR-#625
PR-#2084

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The job explicitly grants write scope and persists checkout credentials before running dependency
installation, test scripts, Python/package scripts, and the dashboard build from the checked-out
branch. Its only actor gate permits every actor other than github-actions[bot], so
branch-controlled code executes while the write credential remains available.

.github/workflows/everyday-mode-implement-201-300.yml[8-25]
.github/workflows/everyday-mode-implement-201-300.yml[93-113]
.github/workflows/everyday-mode-implement-201-300.yml[114-122]
dashboard/package.json[6-35]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A write-scoped, persisted GitHub token is exposed while dependency installation and arbitrary repository-controlled scripts from the feature branch execute, allowing untrusted code to use or exfiltrate the credential.

## Issue Context
The job needs to commit generated changes, but validation code should not execute with write credentials available. Run validation with read-only permissions and no persisted credential, then perform any narrowly scoped final push in a separate trusted job after validation and actor/environment authorization.

## Fix Focus Areas
- .github/workflows/everyday-mode-implement-201-300.yml[8-25]
- .github/workflows/everyday-mode-implement-201-300.yml[93-122]
- dashboard/package.json[6-35]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. Coverage is not checked in 🐞 Bug ≡ Correctness
Description
The EVM-201–300 semantic rules and download-and-execute behavior exist only as Python strings
executed by the branch workflow, while the committed runtime catalog ends after the existing
package-install rule. Merging this diff without that mutable-branch workflow first completing leaves
disk, power, Git, process, package-script, container, and download-and-execute explanations absent
from the release source.
Code

.github/workflows/everyday-mode-implement-201-300.yml[R41-44]

+          rules = '''    SemanticRule(\n        rule_id="system.disk_destructive",\n        action_kind="disk_change",\n        executables=_SYSTEM_EXECUTABLES,\n        required_tokens=(frozenset({"format", "clean", "create", "delete", "mkfs", "--all", "/q"}),),\n        headline="Erase or reconfigure a storage drive",\n        summary="{actor} wants to make a destructive storage change involving {target}.",\n        impact="Files on the affected drive or partition can be permanently lost and the system may become unusable.",\n        recommendation="Confirm the exact drive or partition and make sure required data is backed up.",\n        target_strategy="system",\n        confidence="derived",\n        consequence_level="critical",\n        safer_alternatives=(("preview", "List the exact drive or partition first."), ("backup", "Back up important data before changing storage.")),\n    ),\n    SemanticRule(\n        rule_id="system.power",\n        action_kind="system_change",\n        executables=_SYSTEM_EXECUTABLES,\n        headline="Change this computer's power state",\n        summary="{actor} wants to shut down, restart, halt, or otherwise change {target}.",\n        impact="Running work can be interrupted and unsaved changes may be lost.",\n        recommendation="Confirm that stopping or restarting this computer is expected.",\n        target_strategy="system",\n        confidence="derived",\n        consequence_level="high",\n        safer_alternatives=(("review", "Save active work and confirm the host first."),),\n    ),\n    SemanticRule(\n        rule_id="process.service",\n        action_kind="process_stop",\n        executables=_PROCESS_EXECUTABLES,\n        headline="Stop or change a running process or service",\n        summary="{actor} wants to control {target}.",\n        impact="Applications, background services, or recurring jobs may stop working or become unavailable.",\n        recommendation="Confirm the exact process, service, or job and use the narrowest action.",\n        target_strategy="process",\n        confidence="derived",\n        consequence_level="high",\n        safer_alternatives=(("preview", "Identify the exact running process or service first."), ("narrow", "Target only the intended process or service.")),\n    ),\n    SemanticRule(\n        rule_id="git.remote_rewrite",\n        action_kind="git_remote_change",\n        executables=_GIT_EXECUTABLES,\n        required_tokens=(frozenset({"push"}), frozenset({"--force", "-f", "--force-with-lease", "--delete"})),\n        headline="Rewrite or delete shared Git history",\n        summary="{actor} wants to change shared repository history involving {target}.",\n        impact="Other collaborators can lose commits or need to repair their local branches.",\n        recommendation="Review the remote and branch, preserve a backup ref, and prefer force-with-lease when rewriting is intentional.",\n        target_strategy="git",\n        confidence="exact",\n        consequence_level="high",\n        safer_alternatives=(("backup", "Create a backup branch or tag first."), ("narrow", "Prefer force-with-lease over an unconditional force push.")),\n    ),\n    SemanticRule(\n        rule_id="git.remote_change",\n        action_kind="git_remote_change",\n        executables=_GIT_EXECUTABLES,\n        required_tokens=(frozenset({"remote", "push", "fetch"}), frozenset({"set-url", "remove", "rename", "--delete"})),\n        headline="Change a Git remote or shared reference",\n        summary="{actor} wants to change {target}.",\n        impact="Future pushes, fetches, or shared references can point somewhere different or disappear.",\n        recommendation="Confirm the remote repository and reference before continuing.",\n        target_strategy="git",\n        confidence="derived",\n        consequence_level="high",\n        safer_alternatives=(("preview", "List remotes and references first."),),\n    ),\n    SemanticRule(\n        rule_id="git.local_destructive",\n        action_kind="git_history_rewrite",\n        executables=_GIT_EXECUTABLES,\n        required_tokens=(frozenset({"reset", "clean", "restore", "checkout", "rebase", "branch"}),),\n        headline="Discard or rewrite local Git work",\n        summary="{actor} wants to change local repository history involving {target}.",\n        impact="Uncommitted files, staged work, local commits, or branches can be lost.",\n        recommendation="Inspect the changes first and create a stash or backup branch when anything must be preserved.",\n        target_strategy="git",\n        confidence="derived",\n        consequence_level="high",\n        safer_alternatives=(("preview", "Review Git status and the affected commits first."), ("backup", "Stash changes or create a backup branch.")),\n    ),\n    SemanticRule(\n        rule_id="package.script",\n        action_kind="package_script",\n        executables=_PACKAGE_SCRIPT_EXECUTABLES,\n        required_tokens=(frozenset({"run", "run-script", "exec", "x", "dlx", "postinstall", "prepare", "prepublish", "build"}),),\n        headline="Run a project or package script",\n        summary="{actor} wants to run {target}.",\n        impact="The script can change files, start processes, contact the network, or run code from installed dependencies.",\n        recommendation="Inspect the script definition and run only the narrowest expected target.",\n        target_strategy="package_script",\n        confidence="derived",\n        consequence_level="medium",\n        safer_alternatives=(("preview", "Inspect the script definition before running it."), ("narrow", "Run only the specific expected script.")),\n    ),\n    SemanticRule(\n        rule_id="container.privileged",\n        action_kind="container_change",\n        executables=_CONTAINER_EXECUTABLES,\n        required_tokens=(frozenset({"run", "create"}), frozenset({"--privileged", "--pid=host", "--network=host", "--mount", "-v", "--volume"})),\n        headline="Run a container with broad host access",\n        summary="{actor} wants to run {target} with access that can reach parts of this computer.",\n        impact="The container may be able to read secrets, modify host files, or expose services beyond the container boundary.",\n        recommendation="Use a pinned image, read-only filesystem, and the narrowest mounts and capabilities possible.",\n        target_strategy="container",\n        confidence="derived",\n        consequence_level="high",\n        safer_alternatives=(("isolate", "Use a read-only filesystem and narrow mounts."), ("narrow", "Remove privileged or host-wide access when it is not required.")),\n    ),\n    SemanticRule(\n        rule_id="container.destructive",\n        action_kind="container_change",\n        executables=_CONTAINER_EXECUTABLES,\n        required_tokens=(frozenset({"rm", "prune", "system", "volume", "network"}),),\n        headline="Delete or reconfigure container data",\n        summary="{actor} wants to change {target}.",\n        impact="Containers, images, volumes, networks, or cached data may be removed and may not be recoverable.",\n        recommendation="Preview affected container resources before deleting them.",\n        target_strategy="container",\n        confidence="derived",\n        consequence_level="high",\n        safer_alternatives=(("preview", "List the affected containers, images, volumes, and networks first."),),\n    ),\n    SemanticRule(\n        rule_id="container.change",\n        action_kind="container_change",\n        executables=_CONTAINER_EXECUTABLES,\n        required_tokens=(frozenset({"run", "create", "exec", "start", "stop", "restart", "pull", "build"}),),\n        headline="Run or change a container workload",\n        summary="{actor} wants to change {target}.",\n        impact="Containerized code can change files, processes, networks, and data available to the container.",\n        recommendation="Confirm the image, command, mounts, and network access before continuing.",\n        target_strategy="container",\n        confidence="derived",\n        consequence_level="medium",\n        safer_alternatives=(("narrow", "Use a pinned image and the narrowest permissions."),),\n    ),\n'''
+          rule_anchor = 'SEMANTIC_RULES: tuple[SemanticRule, ...] = (\n'
+          if 'rule_id="system.disk_destructive"' not in text:
+              text = text.replace(rule_anchor, rule_anchor + rules)
Relevance

●●● Strong

The PR's stated intent requires committed runtime coverage; workflow-only generation leaves release
source incomplete.

PR-#2652
PR-#2479

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The only definitions for the new rule families are workflow string literals that are written during
CI; the committed semantic catalog contains no corresponding rules.

.github/workflows/everyday-mode-implement-201-300.yml[30-63]
src/codex_plugin_scanner/guard/runtime/semantic_explanations.py[176-352]
src/codex_plugin_scanner/guard/runtime/action_explanation_builder.py[281-345]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
EVM-201–300 implementations are embedded in a self-mutating CI workflow instead of committed runtime source, so the merged release does not contain the advertised semantic coverage.

## Issue Context
The workflow injects rules and compound download-execution detection only when it runs against a mutable feature branch.

## Fix Focus Areas
- .github/workflows/everyday-mode-implement-201-300.yml[30-63]
- src/codex_plugin_scanner/guard/runtime/semantic_explanations.py[176-352]
- src/codex_plugin_scanner/guard/runtime/action_explanation_builder.py[256-395]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


6. Presentation module is missing 🐞 Bug ≡ Correctness
Description
The new dashboard provider and action-explanation components import a nonexistent
./presentation-mode module, and the code also depends on an absent GuardActionExplanationV1
export and presentation fields in the GuardSettings contract. Because main.tsx mounts the
provider unconditionally, TypeScript/Vite cannot resolve the dependencies and the production
dashboard build is blocked.
Code

dashboard/src/presentation-mode-provider.tsx[R11-18]

+import { fetchSettings, updateSettings } from "./guard-api";
+import {
+  PRESENTATION_SCHEMA_VERSION,
+  resolvePresentationMode,
+  type GuardPresentationMode,
+  type GuardPresentationSource,
+  type ResolvedGuardPresentationMode,
+} from "./presentation-mode";
Relevance

●●● Strong

A directly imported nonexistent module blocks the production dashboard build and is a deterministic
correction.

PR-#983
PR-#690

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Both added components import the missing presentation-mode module, for which no corresponding
.ts or .tsx file exists in the dashboard source tree, and the provider is imported directly by
the application entry point. The action-explanation code also imports a nonexistent
GuardActionExplanationV1 export, while the existing GuardSettings contract ends without the
presentation fields expected by the provider.

dashboard/src/presentation-mode-provider.tsx[11-18]
dashboard/src/action-explanation.tsx[3-5]
dashboard/src/main.tsx[16-22]
dashboard/src/guard-types.ts[892-917]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Fix the dashboard build failure caused by new code depending on a nonexistent `presentation-mode` module, an absent `GuardActionExplanationV1` export, and missing presentation fields in the guard settings contract.

## Issue Context
The presentation-mode provider is mounted unconditionally by the main application entry point, and the action-explanation component imports the same missing module. Add and export the required presentation-mode implementation and Guard explanation/settings types, then ensure the production Vite build can resolve them.

## Fix Focus Areas
- dashboard/src/presentation-mode-provider.tsx[11-18]
- dashboard/src/action-explanation.tsx[3-5]
- dashboard/src/main.tsx[16-21]
- dashboard/src/guard-types.ts[892-917]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


7. Contract type is missing 🐞 Bug ≡ Correctness
Description
ActionExplanation imports GuardActionExplanationV1, but guard-types.ts does not export that
type. This independently prevents the added component and its test from type-checking.
Code

dashboard/src/action-explanation.tsx[3]

+import type { GuardActionExplanationV1 } from "./guard-types";
Relevance

●●● Strong

A missing exported type independently blocks TypeScript compilation; similar module-resolution
defects have been treated as fixes.

PR-#983

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new component imports the symbol, while the dashboard Guard contract defines settings and
surrounding exports but has no GuardActionExplanationV1 declaration/export.

dashboard/src/action-explanation.tsx[3-5]
dashboard/src/guard-types.ts[892-917]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new React component references a Guard action explanation type that is absent from the dashboard type contract.

## Issue Context
The component and its tests require the type at compile time.

## Fix Focus Areas
- dashboard/src/action-explanation.tsx[3-3]
- dashboard/src/guard-types.ts[892-917]
- dashboard/src/action-explanation.test.tsx[7-9]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


8. Settings model rejects preference 🐞 Bug ≡ Correctness
Description
setMode sends presentation fields to updateSettings, whose parameter is Partial<GuardSettings>
and whose declared settings model has no presentation fields. The object literal is rejected by
TypeScript, and no typed API contract is added for persisting the preference.
Code

dashboard/src/presentation-mode-provider.tsx[R139-142]

+      const payload = await updateSettings({
+        presentation_mode: mode,
+        presentation_revision: current.revision,
+      });
Relevance

●●● Strong

The provider sends undeclared settings keys, creating a deterministic TypeScript contract error
requiring API-model alignment.

PR-#2479
PR-#205

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The provider supplies the two undeclared keys directly to a function typed as
Partial<GuardSettings>, and neither key exists on that type.

dashboard/src/presentation-mode-provider.tsx[133-145]
dashboard/src/guard-api.ts[2155-2167]
dashboard/src/guard-types.ts[892-917]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Presentation preference writes use undeclared fields, so the provider cannot type-check or reliably persist the preference.

## Issue Context
`updateSettings` accepts `Partial<GuardSettings>` and forwards that shape to `/v1/settings`.

## Fix Focus Areas
- dashboard/src/presentation-mode-provider.tsx[133-145]
- dashboard/src/guard-api.ts[2155-2167]
- dashboard/src/guard-types.ts[892-917]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


9. Core builder never runs 🐞 Bug ≡ Correctness
Description
The new build_action_explanation entry point has no production caller and ActionExplanation is
not rendered by the application, so the committed Everyday semantics never reach decisions,
approvals, executions, receipts, daemon responses, or dashboard users. Adding the catalog code
without connecting it to the authoritative action pipeline leaves the feature unavailable in
production.
Code

src/codex_plugin_scanner/guard/runtime/action_explanation_builder.py[R143-155]

+def build_action_explanation(
+    *,
+    action_envelope: Mapping[str, object],
+    action_identity: str,
+    actor_label: str,
+    canonical_command: CanonicalCommand | None = None,
+    risk_signals: Sequence[str] = (),
+    extension_ids: Sequence[str] = (),
+    rule_ids: Sequence[str] = (),
+    build_context: ExplanationBuildContext | None = None,
+    retained: bool = True,
+    exact_details_authorized: bool = False,
+) -> GuardActionExplanationV1:
Relevance

●● Moderate

Production wiring is an architectural completeness concern; history supports runtime integration
fixes but not this exact new feature.

PR-#670

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The public builder exists and is called directly by tests, but repository call-site tracing finds no
production module that imports or invokes it; its calls to explain_command are only internal. The
production guard explain command instead uses a different documentation payload builder, so none
of the new semantic output reaches an application response or rendered surface.

src/codex_plugin_scanner/guard/runtime/action_explanation_builder.py[143-173]
tests/test_guard_action_explanation_builder.py[15-32]
src/codex_plugin_scanner/guard/runtime/action_explanation_builder.py[221-247]
src/codex_plugin_scanner/guard/cli/commands_dispatch_admin.py[173-189]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The explanation builder is implemented but has no production caller, and its `ActionExplanation` output is not rendered, so it cannot provide explanations for actions shown in Guard.

## Issue Context
Invoke the builder where authoritative canonical actions and identities are assembled, then project its versioned output into the intended approval and receipt API surfaces using the required authorization and retention inputs. The existing production `guard explain` command uses a different documentation payload path, and no runtime or dashboard surface currently imports the new builder or component.

## Fix Focus Areas
- src/codex_plugin_scanner/guard/runtime/action_explanation_builder.py[143-173]
- src/codex_plugin_scanner/guard/cli/commands_dispatch_admin.py[173-189]
- dashboard/src/action-explanation.tsx[154-187]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


10. Explanation UI is unreachable 🐞 Bug ≡ Correctness
Description
ActionExplanation is only rendered by the new test and is never used by any production dashboard
workspace, so wrapping <App> in the presentation provider does not display Everyday explanations
anywhere. After the build blockers are fixed, users still cannot see the feature described by the
PR.
Code

dashboard/src/action-explanation.tsx[R154-162]

+export function ActionExplanation({
+  explanation,
+  actionIdentity,
+  canonicalIdentity,
+}: {
+  explanation: GuardActionExplanationV1;
+  actionIdentity: string;
+  canonicalIdentity?: string | null;
+}) {
Relevance

●● Moderate

Unreachable production UI is a valid feature-completeness concern, but history lacks a close
precedent for this exact integration gap.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The production entry point adds only the provider. The sole rendering of ActionExplanation is in
the standalone server-render test, so no user-facing route instantiates it.

dashboard/src/main.tsx[16-22]
dashboard/src/action-explanation.test.tsx[80-95]
dashboard/src/action-explanation.tsx[154-189]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The explanation component is not connected to any production dashboard action surface.

## Issue Context
Plumb the versioned explanation payload and current identities into approval/receipt views and render `ActionExplanation` there.

## Fix Focus Areas
- dashboard/src/action-explanation.tsx[154-189]
- dashboard/src/main.tsx[16-22]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


11. Metadata catalog is disconnected 🐞 Bug ≡ Correctness
Description
The new extension metadata parser, coverage validator, and combined digest have no production
callers, so built-in rules are never checked for explanation coverage and metadata changes never
affect the runtime catalog digest. The documented extension explanation guarantees therefore exist
only in unit tests.
Code

src/codex_plugin_scanner/guard/runtime/command_extension_explanations.py[R131-136]

+def validate_builtin_explanation_coverage(
+    *,
+    rule_ids: Sequence[str],
+    catalog: CommandExtensionExplanationCatalog,
+    explicit_generic_fallbacks: Sequence[str] = (),
+) -> None:
Relevance

●● Moderate

Disconnected validation and digest logic is plausibly relevant, but no close precedent establishes
acceptance for unused metadata APIs.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The module defines parsing, coverage, and digest functions, while its only demonstrated consumers
are isolated unit tests; the semantic builder instead uses its independent
stable_semantic_catalog_digest.

src/codex_plugin_scanner/guard/runtime/command_extension_explanations.py[105-156]
src/codex_plugin_scanner/guard/runtime/action_explanation_builder.py[176-196]
tests/test_guard_command_extension_explanations.py[90-108]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Extension explanation metadata is parsed and tested but never loaded or validated by production code.

## Issue Context
Integrate verified metadata with the built-in extension registry, run coverage validation, and use the bound digest in generated explanations.

## Fix Focus Areas
- src/codex_plugin_scanner/guard/runtime/command_extension_explanations.py[105-156]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

12. Separators mimic pipe execution 🐞 Bug ≡ Correctness
Description
The injected download_and_execute detector treats any later interpreter segment as consuming the
download, so curl https://example.test/status; sh local.sh is labeled as passing downloaded
content directly to the interpreter even though the commands are independent. The canonical model
already records execution context and pipeline index, but the detector ignores both.
Code

.github/workflows/everyday-mode-implement-201-300.yml[55]

+          detection = '''    shell_runners = {"sh", "bash", "zsh", "fish", "pwsh", "powershell", "cmd", "python", "python3", "node"}\n    download_and_execute = bool(\n        step_explanations\n        and step_explanations[0].kind in {"network_read", "download"}\n        and any(str(segment.executable or "").casefold() in shell_runners for segment in command.segments[1:])\n    )\n'''
Relevance

●●● Strong

Accepted precedents require command-segment relationships to avoid correlating independent shell
commands.

PR-#225
PR-#398

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The generated condition checks only that the first semantic kind is network-related and that any
later executable is in a runner set. Canonical segments distinguish command groups with
execution_context and pipeline members with pipeline_index, proving the necessary relationship
is available but unused.

.github/workflows/everyday-mode-implement-201-300.yml[55-62]
src/codex_plugin_scanner/guard/runtime/command_model.py[293-318]
src/codex_plugin_scanner/guard/runtime/command_model.py[42-68]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Download-and-execute detection conflates sequential commands with a download piped into an interpreter.

## Issue Context
Use canonical execution context and adjacent pipeline indexes to prove the interpreter consumes the network command's output.

## Fix Focus Areas
- .github/workflows/everyday-mode-implement-201-300.yml[55-62]
- src/codex_plugin_scanner/guard/runtime/command_model.py[293-318]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


13. Path interpreters evade detection 🐞 Bug ≡ Correctness
Description
The injected detector compares the raw canonical executable against bare names, so common forms such
as curl … | /bin/sh are left as generic compound actions instead of download_and_execute. This
loses the specific consequence and safer recommendation precisely for a known pipe-to-execution
variant.
Code

.github/workflows/everyday-mode-implement-201-300.yml[55]

+          detection = '''    shell_runners = {"sh", "bash", "zsh", "fish", "pwsh", "powershell", "cmd", "python", "python3", "node"}\n    download_and_execute = bool(\n        step_explanations\n        and step_explanations[0].kind in {"network_read", "download"}\n        and any(str(segment.executable or "").casefold() in shell_runners for segment in command.segments[1:])\n    )\n'''
Relevance

●●● Strong

A closely matching accepted precedent explicitly requires absolute-path and wrapped interpreter
recognition.

PR-#398

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The detector case-folds segment.executable but does not strip a path or suffix. The canonical
parser stores the command token directly as the executable, so /bin/sh remains /bin/sh and
cannot equal sh; the past accepted fix documents the same path/wrapper bypass pattern.

.github/workflows/everyday-mode-implement-201-300.yml[55-62]
src/codex_plugin_scanner/guard/runtime/command_model.py[245-264]
PR-#398

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Absolute/relative interpreter paths and wrapper variants do not match the bare runner-name set.

## Issue Context
Normalize executable basenames and account for canonical wrappers before testing whether a piped segment executes downloaded content.

## Fix Focus Areas
- .github/workflows/everyday-mode-implement-201-300.yml[55-62]
- src/codex_plugin_scanner/guard/runtime/command_model.py[245-264]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


14. Export artifact names wrong commit 🐞 Bug ☼ Reliability
Description
Both workflows check out a mutable branch name rather than the triggering push event’s commit, so a
queued run can process a later branch tip. The export job may consequently archive one commit’s
HEAD while labeling the artifact with the older ${{ github.sha }}, and the implementation job
may validate or attempt to push a different revision.
Code

.github/workflows/everyday-mode-source-export-201-300.yml[R16-25]

+      - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10
+        with:
+          ref: feat/everyday-mode-201-300
+          fetch-depth: 1
+          persist-credentials: false
+      - run: git archive --format=tar.gz --output="$RUNNER_TEMP/source.tar.gz" HEAD
+      - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
+        with:
+          name: everyday-mode-201-300-source-${{ github.sha }}
+          path: ${{ runner.temp }}/source.tar.gz
Relevance

●●● Strong

Recent workflow precedents accept binding produced artifacts and verification to immutable revisions
and exact targets.

PR-#2087
PR-#2653

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Each checkout resolves a mutable branch ref, while the export archives the resolved HEAD but
constructs the artifact name from the immutable event SHA; these can differ after the branch
advances. The implementation workflow can itself push a later commit to the same branch,
demonstrating how the checked-out revision can move beyond the triggering commit.

.github/workflows/everyday-mode-source-export-201-300.yml[16-25]
.github/workflows/everyday-mode-implement-201-300.yml[114-122]
.github/workflows/everyday-mode-implement-201-300.yml[21-24]

...

Comment on lines +18 to +23
from .action_explanation_contract import (
ACTION_EXPLANATION_REDACTION_VERSION,
ACTION_EXPLANATION_RENDERER_VERSION,
GuardActionExplanationV1,
parse_action_explanation,
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

2. Python contract module missing 🐞 Bug ≡ Correctness

Both new runtime modules import action_explanation_contract, but that module is absent from the PR
branch, so importing either module raises ModuleNotFoundError and the workflow's pytest validation
cannot run. This prevents all new Core explanation functionality from loading.
Agent Prompt
## Issue description
The new explanation runtime imports a contract module that is not present, so tests and runtime imports fail.

## Issue Context
Provide the contract classes, constants, parser, and action-kind definitions consumed by both new runtime modules.

## Fix Focus Areas
- src/codex_plugin_scanner/guard/runtime/action_explanation_builder.py[18-23]
- src/codex_plugin_scanner/guard/runtime/semantic_explanations.py[19-27]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +143 to +155
def build_action_explanation(
*,
action_envelope: Mapping[str, object],
action_identity: str,
actor_label: str,
canonical_command: CanonicalCommand | None = None,
risk_signals: Sequence[str] = (),
extension_ids: Sequence[str] = (),
rule_ids: Sequence[str] = (),
build_context: ExplanationBuildContext | None = None,
retained: bool = True,
exact_details_authorized: bool = False,
) -> GuardActionExplanationV1:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

3. Core builder never runs 🐞 Bug ≡ Correctness

The new build_action_explanation entry point has no production caller and ActionExplanation is
not rendered by the application, so the committed Everyday semantics never reach decisions,
approvals, executions, receipts, daemon responses, or dashboard users. Adding the catalog code
without connecting it to the authoritative action pipeline leaves the feature unavailable in
production.
Agent Prompt
## Issue description
The explanation builder is implemented but has no production caller, and its `ActionExplanation` output is not rendered, so it cannot provide explanations for actions shown in Guard.

## Issue Context
Invoke the builder where authoritative canonical actions and identities are assembled, then project its versioned output into the intended approval and receipt API surfaces using the required authorization and retention inputs. The existing production `guard explain` command uses a different documentation payload path, and no runtime or dashboard surface currently imports the new builder or component.

## Fix Focus Areas
- src/codex_plugin_scanner/guard/runtime/action_explanation_builder.py[143-173]
- src/codex_plugin_scanner/guard/cli/commands_dispatch_admin.py[173-189]
- dashboard/src/action-explanation.tsx[154-187]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +154 to +162
export function ActionExplanation({
explanation,
actionIdentity,
canonicalIdentity,
}: {
explanation: GuardActionExplanationV1;
actionIdentity: string;
canonicalIdentity?: string | null;
}) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

4. Explanation ui is unreachable 🐞 Bug ≡ Correctness

ActionExplanation is only rendered by the new test and is never used by any production dashboard
workspace, so wrapping <App> in the presentation provider does not display Everyday explanations
anywhere. After the build blockers are fixed, users still cannot see the feature described by the
PR.
Agent Prompt
## Issue description
The explanation component is not connected to any production dashboard action surface.

## Issue Context
Plumb the versioned explanation payload and current identities into approval/receipt views and render `ActionExplanation` there.

## Fix Focus Areas
- dashboard/src/action-explanation.tsx[154-189]
- dashboard/src/main.tsx[16-22]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +131 to +136
def validate_builtin_explanation_coverage(
*,
rule_ids: Sequence[str],
catalog: CommandExtensionExplanationCatalog,
explicit_generic_fallbacks: Sequence[str] = (),
) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

5. Metadata catalog is disconnected 🐞 Bug ≡ Correctness

The new extension metadata parser, coverage validator, and combined digest have no production
callers, so built-in rules are never checked for explanation coverage and metadata changes never
affect the runtime catalog digest. The documented extension explanation guarantees therefore exist
only in unit tests.
Agent Prompt
## Issue description
Extension explanation metadata is parsed and tested but never loaded or validated by production code.

## Issue Context
Integrate verified metadata with the built-in extension registry, run coverage validation, and use the bound digest in generated explanations.

## Fix Focus Areas
- src/codex_plugin_scanner/guard/runtime/command_extension_explanations.py[105-156]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

builder = Path('src/codex_plugin_scanner/guard/runtime/action_explanation_builder.py')
text = builder.read_text()
anchor = ' material = [step for step in step_explanations if step.kind != "unknown_action"]\n'
detection = ''' shell_runners = {"sh", "bash", "zsh", "fish", "pwsh", "powershell", "cmd", "python", "python3", "node"}\n download_and_execute = bool(\n step_explanations\n and step_explanations[0].kind in {"network_read", "download"}\n and any(str(segment.executable or "").casefold() in shell_runners for segment in command.segments[1:])\n )\n'''

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remediation recommended

6. Separators mimic pipe execution 🐞 Bug ≡ Correctness

The injected download_and_execute detector treats any later interpreter segment as consuming the
download, so curl https://example.test/status; sh local.sh is labeled as passing downloaded
content directly to the interpreter even though the commands are independent. The canonical model
already records execution context and pipeline index, but the detector ignores both.
Agent Prompt
## Issue description
Download-and-execute detection conflates sequential commands with a download piped into an interpreter.

## Issue Context
Use canonical execution context and adjacent pipeline indexes to prove the interpreter consumes the network command's output.

## Fix Focus Areas
- .github/workflows/everyday-mode-implement-201-300.yml[55-62]
- src/codex_plugin_scanner/guard/runtime/command_model.py[293-318]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +41 to +44
rules = ''' SemanticRule(\n rule_id="system.disk_destructive",\n action_kind="disk_change",\n executables=_SYSTEM_EXECUTABLES,\n required_tokens=(frozenset({"format", "clean", "create", "delete", "mkfs", "--all", "/q"}),),\n headline="Erase or reconfigure a storage drive",\n summary="{actor} wants to make a destructive storage change involving {target}.",\n impact="Files on the affected drive or partition can be permanently lost and the system may become unusable.",\n recommendation="Confirm the exact drive or partition and make sure required data is backed up.",\n target_strategy="system",\n confidence="derived",\n consequence_level="critical",\n safer_alternatives=(("preview", "List the exact drive or partition first."), ("backup", "Back up important data before changing storage.")),\n ),\n SemanticRule(\n rule_id="system.power",\n action_kind="system_change",\n executables=_SYSTEM_EXECUTABLES,\n headline="Change this computer's power state",\n summary="{actor} wants to shut down, restart, halt, or otherwise change {target}.",\n impact="Running work can be interrupted and unsaved changes may be lost.",\n recommendation="Confirm that stopping or restarting this computer is expected.",\n target_strategy="system",\n confidence="derived",\n consequence_level="high",\n safer_alternatives=(("review", "Save active work and confirm the host first."),),\n ),\n SemanticRule(\n rule_id="process.service",\n action_kind="process_stop",\n executables=_PROCESS_EXECUTABLES,\n headline="Stop or change a running process or service",\n summary="{actor} wants to control {target}.",\n impact="Applications, background services, or recurring jobs may stop working or become unavailable.",\n recommendation="Confirm the exact process, service, or job and use the narrowest action.",\n target_strategy="process",\n confidence="derived",\n consequence_level="high",\n safer_alternatives=(("preview", "Identify the exact running process or service first."), ("narrow", "Target only the intended process or service.")),\n ),\n SemanticRule(\n rule_id="git.remote_rewrite",\n action_kind="git_remote_change",\n executables=_GIT_EXECUTABLES,\n required_tokens=(frozenset({"push"}), frozenset({"--force", "-f", "--force-with-lease", "--delete"})),\n headline="Rewrite or delete shared Git history",\n summary="{actor} wants to change shared repository history involving {target}.",\n impact="Other collaborators can lose commits or need to repair their local branches.",\n recommendation="Review the remote and branch, preserve a backup ref, and prefer force-with-lease when rewriting is intentional.",\n target_strategy="git",\n confidence="exact",\n consequence_level="high",\n safer_alternatives=(("backup", "Create a backup branch or tag first."), ("narrow", "Prefer force-with-lease over an unconditional force push.")),\n ),\n SemanticRule(\n rule_id="git.remote_change",\n action_kind="git_remote_change",\n executables=_GIT_EXECUTABLES,\n required_tokens=(frozenset({"remote", "push", "fetch"}), frozenset({"set-url", "remove", "rename", "--delete"})),\n headline="Change a Git remote or shared reference",\n summary="{actor} wants to change {target}.",\n impact="Future pushes, fetches, or shared references can point somewhere different or disappear.",\n recommendation="Confirm the remote repository and reference before continuing.",\n target_strategy="git",\n confidence="derived",\n consequence_level="high",\n safer_alternatives=(("preview", "List remotes and references first."),),\n ),\n SemanticRule(\n rule_id="git.local_destructive",\n action_kind="git_history_rewrite",\n executables=_GIT_EXECUTABLES,\n required_tokens=(frozenset({"reset", "clean", "restore", "checkout", "rebase", "branch"}),),\n headline="Discard or rewrite local Git work",\n summary="{actor} wants to change local repository history involving {target}.",\n impact="Uncommitted files, staged work, local commits, or branches can be lost.",\n recommendation="Inspect the changes first and create a stash or backup branch when anything must be preserved.",\n target_strategy="git",\n confidence="derived",\n consequence_level="high",\n safer_alternatives=(("preview", "Review Git status and the affected commits first."), ("backup", "Stash changes or create a backup branch.")),\n ),\n SemanticRule(\n rule_id="package.script",\n action_kind="package_script",\n executables=_PACKAGE_SCRIPT_EXECUTABLES,\n required_tokens=(frozenset({"run", "run-script", "exec", "x", "dlx", "postinstall", "prepare", "prepublish", "build"}),),\n headline="Run a project or package script",\n summary="{actor} wants to run {target}.",\n impact="The script can change files, start processes, contact the network, or run code from installed dependencies.",\n recommendation="Inspect the script definition and run only the narrowest expected target.",\n target_strategy="package_script",\n confidence="derived",\n consequence_level="medium",\n safer_alternatives=(("preview", "Inspect the script definition before running it."), ("narrow", "Run only the specific expected script.")),\n ),\n SemanticRule(\n rule_id="container.privileged",\n action_kind="container_change",\n executables=_CONTAINER_EXECUTABLES,\n required_tokens=(frozenset({"run", "create"}), frozenset({"--privileged", "--pid=host", "--network=host", "--mount", "-v", "--volume"})),\n headline="Run a container with broad host access",\n summary="{actor} wants to run {target} with access that can reach parts of this computer.",\n impact="The container may be able to read secrets, modify host files, or expose services beyond the container boundary.",\n recommendation="Use a pinned image, read-only filesystem, and the narrowest mounts and capabilities possible.",\n target_strategy="container",\n confidence="derived",\n consequence_level="high",\n safer_alternatives=(("isolate", "Use a read-only filesystem and narrow mounts."), ("narrow", "Remove privileged or host-wide access when it is not required.")),\n ),\n SemanticRule(\n rule_id="container.destructive",\n action_kind="container_change",\n executables=_CONTAINER_EXECUTABLES,\n required_tokens=(frozenset({"rm", "prune", "system", "volume", "network"}),),\n headline="Delete or reconfigure container data",\n summary="{actor} wants to change {target}.",\n impact="Containers, images, volumes, networks, or cached data may be removed and may not be recoverable.",\n recommendation="Preview affected container resources before deleting them.",\n target_strategy="container",\n confidence="derived",\n consequence_level="high",\n safer_alternatives=(("preview", "List the affected containers, images, volumes, and networks first."),),\n ),\n SemanticRule(\n rule_id="container.change",\n action_kind="container_change",\n executables=_CONTAINER_EXECUTABLES,\n required_tokens=(frozenset({"run", "create", "exec", "start", "stop", "restart", "pull", "build"}),),\n headline="Run or change a container workload",\n summary="{actor} wants to change {target}.",\n impact="Containerized code can change files, processes, networks, and data available to the container.",\n recommendation="Confirm the image, command, mounts, and network access before continuing.",\n target_strategy="container",\n confidence="derived",\n consequence_level="medium",\n safer_alternatives=(("narrow", "Use a pinned image and the narrowest permissions."),),\n ),\n'''
rule_anchor = 'SEMANTIC_RULES: tuple[SemanticRule, ...] = (\n'
if 'rule_id="system.disk_destructive"' not in text:
text = text.replace(rule_anchor, rule_anchor + rules)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

11. Coverage is not checked in 🐞 Bug ≡ Correctness

The EVM-201–300 semantic rules and download-and-execute behavior exist only as Python strings
executed by the branch workflow, while the committed runtime catalog ends after the existing
package-install rule. Merging this diff without that mutable-branch workflow first completing leaves
disk, power, Git, process, package-script, container, and download-and-execute explanations absent
from the release source.
Agent Prompt
## Issue description
EVM-201–300 implementations are embedded in a self-mutating CI workflow instead of committed runtime source, so the merged release does not contain the advertised semantic coverage.

## Issue Context
The workflow injects rules and compound download-execution detection only when it runs against a mutable feature branch.

## Fix Focus Areas
- .github/workflows/everyday-mode-implement-201-300.yml[30-63]
- src/codex_plugin_scanner/guard/runtime/semantic_explanations.py[176-352]
- src/codex_plugin_scanner/guard/runtime/action_explanation_builder.py[256-395]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +11 to +18
import { fetchSettings, updateSettings } from "./guard-api";
import {
PRESENTATION_SCHEMA_VERSION,
resolvePresentationMode,
type GuardPresentationMode,
type GuardPresentationSource,
type ResolvedGuardPresentationMode,
} from "./presentation-mode";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

12. Presentation module is missing 🐞 Bug ≡ Correctness

The new dashboard provider and action-explanation components import a nonexistent
./presentation-mode module, and the code also depends on an absent GuardActionExplanationV1
export and presentation fields in the GuardSettings contract. Because main.tsx mounts the
provider unconditionally, TypeScript/Vite cannot resolve the dependencies and the production
dashboard build is blocked.
Agent Prompt
## Issue description
Fix the dashboard build failure caused by new code depending on a nonexistent `presentation-mode` module, an absent `GuardActionExplanationV1` export, and missing presentation fields in the guard settings contract.

## Issue Context
The presentation-mode provider is mounted unconditionally by the main application entry point, and the action-explanation component imports the same missing module. Add and export the required presentation-mode implementation and Guard explanation/settings types, then ensure the production Vite build can resolve them.

## Fix Focus Areas
- dashboard/src/presentation-mode-provider.tsx[11-18]
- dashboard/src/action-explanation.tsx[3-5]
- dashboard/src/main.tsx[16-21]
- dashboard/src/guard-types.ts[892-917]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@@ -0,0 +1,189 @@
import { useEffect, useId, useState, type ReactNode } from "react";

import type { GuardActionExplanationV1 } from "./guard-types";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

13. Contract type is missing 🐞 Bug ≡ Correctness

ActionExplanation imports GuardActionExplanationV1, but guard-types.ts does not export that
type. This independently prevents the added component and its test from type-checking.
Agent Prompt
## Issue description
The new React component references a Guard action explanation type that is absent from the dashboard type contract.

## Issue Context
The component and its tests require the type at compile time.

## Fix Focus Areas
- dashboard/src/action-explanation.tsx[3-3]
- dashboard/src/guard-types.ts[892-917]
- dashboard/src/action-explanation.test.tsx[7-9]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +139 to +142
const payload = await updateSettings({
presentation_mode: mode,
presentation_revision: current.revision,
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

14. Settings model rejects preference 🐞 Bug ≡ Correctness

setMode sends presentation fields to updateSettings, whose parameter is Partial<GuardSettings>
and whose declared settings model has no presentation fields. The object literal is rejected by
TypeScript, and no typed API contract is added for persisting the preference.
Agent Prompt
## Issue description
Presentation preference writes use undeclared fields, so the provider cannot type-check or reliably persist the preference.

## Issue Context
`updateSettings` accepts `Partial<GuardSettings>` and forwards that shape to `/v1/settings`.

## Fix Focus Areas
- dashboard/src/presentation-mode-provider.tsx[133-145]
- dashboard/src/guard-api.ts[2155-2167]
- dashboard/src/guard-types.ts[892-917]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +16 to +25
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10
with:
ref: feat/everyday-mode-201-300
fetch-depth: 1
persist-credentials: false
- run: git archive --format=tar.gz --output="$RUNNER_TEMP/source.tar.gz" HEAD
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
with:
name: everyday-mode-201-300-source-${{ github.sha }}
path: ${{ runner.temp }}/source.tar.gz

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remediation recommended

15. Export artifact names wrong commit 🐞 Bug ☼ Reliability

Both workflows check out a mutable branch name rather than the triggering push event’s commit, so a
queued run can process a later branch tip. The export job may consequently archive one commit’s
HEAD while labeling the artifact with the older ${{ github.sha }}, and the implementation job
may validate or attempt to push a different revision.
Agent Prompt
## Issue description
Workflow outputs are not pinned to the commit identified by their push event. If the feature branch advances while a run is queued or active, the source archive can contain a different commit from the SHA embedded in its artifact name, and the implementation job can validate or attempt to push a different revision.

## Issue Context
The workflows check out a mutable branch ref instead of `${{ github.sha }}`. The export job archives the checkout’s `HEAD` but names the artifact using the immutable event SHA; use the event SHA for deterministic validation and export, and explicitly handle branch advancement before any final push.

## Fix Focus Areas
- .github/workflows/everyday-mode-source-export-201-300.yml[16-25]
- .github/workflows/everyday-mode-implement-201-300.yml[21-24]
- .github/workflows/everyday-mode-implement-201-300.yml[114-122]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@capy-ai capy-ai 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.

Capy found 4 potential issues (3 high, 1 medium).

View 2 other findings in Capy.

Open in Capy Review

Comment on lines +178 to +352
rule_id="filesystem.delete.recursive",
action_kind="file_delete",
executables=_DELETE_EXECUTABLES,
required_tokens=(frozenset({"-r", "-rf", "-fr", "--recursive", "/s", "-recurse"}),),
headline="Delete a folder and everything inside it",
summary="{actor} wants to permanently remove {target}, including files and subfolders.",
impact="Files that are not backed up may be difficult or impossible to recover.",
recommendation="Confirm that the folder is the intended one and that important work is backed up.",
target_strategy="filesystem",
confidence="exact",
consequence_level="high",
safer_alternatives=(("preview", "Preview the folder contents first."), ("backup", "Create a backup before deleting it.")),
),
SemanticRule(
rule_id="filesystem.delete",
action_kind="file_delete",
executables=_DELETE_EXECUTABLES,
headline="Delete a file or folder",
summary="{actor} wants to permanently remove {target}.",
impact="The removed item may not be recoverable.",
recommendation="Confirm the target and keep a backup of anything important.",
target_strategy="filesystem",
confidence="exact",
consequence_level="high",
safer_alternatives=(("preview", "Inspect the target first."), ("backup", "Create a backup before deleting it.")),
),
SemanticRule(
rule_id="filesystem.copy",
action_kind="file_write",
executables=_COPY_EXECUTABLES,
headline="Copy files or folders",
summary="{actor} wants to copy data involving {target}.",
impact="Existing files at the destination may be replaced, and additional copies may contain sensitive information.",
recommendation="Confirm the destination and whether replacing existing files is intended.",
target_strategy="filesystem",
confidence="derived",
consequence_level="medium",
safer_alternatives=(("preview", "Preview destination conflicts first."), ("backup", "Back up files that may be replaced.")),
),
SemanticRule(
rule_id="filesystem.move",
action_kind="file_move",
executables=_MOVE_EXECUTABLES,
headline="Move or rename files",
summary="{actor} wants to move or rename data involving {target}.",
impact="Programs or links that expect the old location may stop working, and existing destination files may be replaced.",
recommendation="Confirm both the source and destination before continuing.",
target_strategy="filesystem",
confidence="derived",
consequence_level="medium",
safer_alternatives=(("preview", "Preview destination conflicts first."), ("backup", "Back up files that may be replaced.")),
),
SemanticRule(
rule_id="filesystem.permissions",
action_kind="permission_change",
executables=_PERMISSION_EXECUTABLES,
headline="Change who can access files",
summary="{actor} wants to change ownership or access permissions for {target}.",
impact="The change may expose private data or prevent you and your apps from opening the affected files.",
recommendation="Use the narrowest permissions needed and verify the exact target.",
target_strategy="filesystem",
confidence="derived",
consequence_level="high",
safer_alternatives=(("preview", "Inspect current permissions first."), ("narrow", "Limit the change to the smallest required path and permission.")),
),
SemanticRule(
rule_id="credentials.read",
action_kind="secret_read",
executables=_READ_EXECUTABLES,
headline="Read saved credentials",
summary="{actor} wants to read {target}.",
impact="The contents may include passwords, private keys, access tokens, or other secrets.",
recommendation="Only continue when this app needs the credential and you trust where the data will be used.",
target_strategy="sensitive",
confidence="exact",
consequence_level="high",
safer_alternatives=(("narrow", "Use a credential helper or narrowly scoped environment variable instead."),),
),
SemanticRule(
rule_id="network.upload",
action_kind="network_send",
executables=_NETWORK_EXECUTABLES,
required_tokens=(frozenset({"-d", "--data", "--data-binary", "--form", "--upload-file", "--body", "-infile"}),),
headline="Send data to a website",
summary="{actor} wants to send data to {target}.",
impact="The destination may retain, process, or redistribute the sent information.",
recommendation="Confirm the destination and make sure no private files or credentials are included.",
target_strategy="network",
confidence="derived",
consequence_level="high",
safer_alternatives=(("narrow", "Send only the minimum required data."), ("review", "Verify the destination before sending anything private.")),
),
SemanticRule(
rule_id="network.download",
action_kind="download",
executables=_NETWORK_EXECUTABLES,
required_tokens=(frozenset({"-o", "--output", "-outfile", "--remote-name", "-o-"}),),
headline="Download a file from the internet",
summary="{actor} wants to download content from {target} and save it on this computer.",
impact="Downloaded files can replace local data or contain unsafe software.",
recommendation="Verify the source and inspect the downloaded file before opening or running it.",
target_strategy="network",
confidence="derived",
consequence_level="medium",
safer_alternatives=(("preview", "Download the file without running it automatically."), ("review", "Verify a checksum or signature when available.")),
),
SemanticRule(
rule_id="network.request",
action_kind="network_read",
executables=_NETWORK_EXECUTABLES,
headline="Connect to a website or service",
summary="{actor} wants to contact {target}.",
impact="The destination can observe request details and may return untrusted content.",
recommendation="Confirm that the destination is expected and trusted.",
target_strategy="network",
confidence="derived",
consequence_level="medium",
safer_alternatives=(("preview", "Use a read-only or preview request when available."),),
),
SemanticRule(
rule_id="network.remote-copy",
action_kind="network_send",
executables=_REMOTE_COPY_EXECUTABLES,
headline="Transfer files to or from another computer",
summary="{actor} wants to transfer data involving {target}.",
impact="Files may leave this computer, arrive from an untrusted host, or replace existing data.",
recommendation="Confirm the remote computer, direction, and exact files.",
target_strategy="remote",
confidence="derived",
consequence_level="high",
safer_alternatives=(("isolate", "Use a dedicated empty destination folder."), ("review", "Verify the remote host identity first.")),
),
SemanticRule(
rule_id="package.publish",
action_kind="network_send",
executables=_PACKAGE_EXECUTABLES,
required_tokens=(frozenset({"publish", "upload", "push"}),),
headline="Publish a software package",
summary="{actor} wants to publish {target} to a package service.",
impact="Published code or files may become available to other people and can be difficult to retract completely.",
recommendation="Review the package contents, destination account, version, and included secrets before publishing.",
target_strategy="package",
confidence="exact",
consequence_level="high",
safer_alternatives=(("preview", "Run a package dry run or inspect the archive first."),),
),
SemanticRule(
rule_id="package.remove",
action_kind="package_remove",
executables=_PACKAGE_EXECUTABLES,
required_tokens=(frozenset({"remove", "rm", "uninstall", "erase"}),),
headline="Remove software packages",
summary="{actor} wants to remove {target}.",
impact="Apps, scripts, or project builds that depend on the package may stop working.",
recommendation="Confirm the package and scope before removing it.",
target_strategy="package",
confidence="exact",
consequence_level="medium",
safer_alternatives=(("review", "Check which projects depend on the package first."),),
),
SemanticRule(
rule_id="package.install",
action_kind="package_install",
executables=_PACKAGE_EXECUTABLES,
required_tokens=(frozenset({"install", "add", "i", "get"}),),
headline="Install software packages",
summary="{actor} wants to install {target}.",
impact="Package installation can run third-party code and change project or system files.",
recommendation="Confirm the package name, source, version, and whether installation is limited to this project.",
target_strategy="package",
confidence="exact",
consequence_level="medium",
safer_alternatives=(("narrow", "Pin an exact version."), ("isolate", "Install inside an isolated project environment.")),
),
)

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.

High: Claimed EVM-201–300 semantic families are not in the Core catalog; only the earlier 13 filesystem/network/package rules ship.

The PR title, body, and docs/guard/everyday-mode/semantic-coverage-201-300.md state coverage for disk/power, process/service, local and remote Git, download-and-execute, package scripts, and containers. SEMANTIC_RULES in semantic_explanations.py still only defines filesystem.delete/copy/move/permissions, credentials.read, network.upload/download/request/remote-copy, and package.publish/remove/install. The commit titled "feat: implement Everyday Mode EVM 201-300" only added the implement workflow; that workflow's inlined Python was supposed to inject the new rules, target strategies, download_and_execute compound handling, tests/test_guard_everyday_semantic_201_300.py, and dashboard coverage, but those artifacts are absent at HEAD. Commands such as git push --force, git reset --hard, docker run --privileged, format C:, shutdown, taskkill, npm run build, and curl … | sh therefore fall through to unknown_action / limited confidence instead of the promised everyday explanations. Land the intended catalog, strategies, compound download+execute path, and tests in the tree (or re-run and commit the workflow output), and drop the stale claim from the docs until they match.

Open in Capy Review

Comment on lines +19 to +27
from .action_explanation_contract import (
ACTION_EXPLANATION_REDACTION_VERSION,
ACTION_EXPLANATION_RENDERER_VERSION,
ACTION_EXPLANATION_SCHEMA_VERSION,
ACTION_EXPLANATION_VERSION,
ACTION_KINDS,
GuardActionExplanationV1,
parse_action_explanation,
)

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.

High: New Core explanation modules import action_explanation_contract, which does not exist on this branch.

semantic_explanations.py and action_explanation_builder.py both import ACTION_EXPLANATION_* constants, ACTION_KINDS, GuardActionExplanationV1, and parse_action_explanation from .action_explanation_contract. That module is not present at HEAD or at the PR merge base; it only exists on the current release/3.0 tip (Everyday foundation). Any import of explain_command or build_action_explanation raises ImportError, so the new tests and any consumer of these APIs cannot load. Rebase/merge onto the foundation commit that introduces the contract (and resolve conflicts), or vendor the contract into this branch before treating the catalog as shippable.

Open in Capy Review

Comment on lines +12 to +18
import {
PRESENTATION_SCHEMA_VERSION,
resolvePresentationMode,
type GuardPresentationMode,
type GuardPresentationSource,
type ResolvedGuardPresentationMode,
} from "./presentation-mode";

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.

High: Dashboard presentation entrypoints import missing presentation-mode and will not compile on this HEAD.

main.tsx wraps the app in PresentationModeProvider. That provider and action-explanation.tsx import resolvePresentationMode, defaultTechnicalDisclosure, PRESENTATION_SCHEMA_VERSION, and related types from ./presentation-mode, but dashboard/src/presentation-mode.ts is absent at HEAD and at the merge base (it only exists on the current release/3.0 tip). Bundling or typechecking the dashboard fails on the unresolved module, and action-explanation.test.tsx cannot run even if wired. Bring presentation-mode.ts onto the branch via rebase onto the Everyday foundation, or stop mounting the provider until the dependency is present.

Open in Capy Review

Comment on lines +9 to +122
contents: write

concurrency:
group: everyday-mode-implement-201-300
cancel-in-progress: false

jobs:
implement:
if: github.actor != 'github-actions[bot]'
runs-on: ubuntu-24.04
timeout-minutes: 60
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10
with:
ref: feat/everyday-mode-201-300
fetch-depth: 0
persist-credentials: true
- name: Implement semantic coverage
shell: bash
run: |
set -euo pipefail
python - <<'PY'
from pathlib import Path
import json

runtime = Path('src/codex_plugin_scanner/guard/runtime/semantic_explanations.py')
text = runtime.read_text()
constants = '''\n_SYSTEM_EXECUTABLES = frozenset({"mkfs", "format", "diskpart", "shutdown", "reboot", "poweroff", "halt"})\n_PROCESS_EXECUTABLES = frozenset({"kill", "pkill", "killall", "taskkill", "service", "systemctl", "launchctl", "sc", "schtasks"})\n_GIT_EXECUTABLES = frozenset({"git"})\n_CONTAINER_EXECUTABLES = frozenset({"docker", "podman", "nerdctl"})\n_PACKAGE_SCRIPT_EXECUTABLES = frozenset({"npm", "pnpm", "yarn", "bun", "npx", "pnpx"})\n'''
anchor = '\n\nSEMANTIC_RULES: tuple[SemanticRule, ...] = (\n'
if '_SYSTEM_EXECUTABLES' not in text:
text = text.replace(anchor, constants + anchor)

rules = ''' SemanticRule(\n rule_id="system.disk_destructive",\n action_kind="disk_change",\n executables=_SYSTEM_EXECUTABLES,\n required_tokens=(frozenset({"format", "clean", "create", "delete", "mkfs", "--all", "/q"}),),\n headline="Erase or reconfigure a storage drive",\n summary="{actor} wants to make a destructive storage change involving {target}.",\n impact="Files on the affected drive or partition can be permanently lost and the system may become unusable.",\n recommendation="Confirm the exact drive or partition and make sure required data is backed up.",\n target_strategy="system",\n confidence="derived",\n consequence_level="critical",\n safer_alternatives=(("preview", "List the exact drive or partition first."), ("backup", "Back up important data before changing storage.")),\n ),\n SemanticRule(\n rule_id="system.power",\n action_kind="system_change",\n executables=_SYSTEM_EXECUTABLES,\n headline="Change this computer's power state",\n summary="{actor} wants to shut down, restart, halt, or otherwise change {target}.",\n impact="Running work can be interrupted and unsaved changes may be lost.",\n recommendation="Confirm that stopping or restarting this computer is expected.",\n target_strategy="system",\n confidence="derived",\n consequence_level="high",\n safer_alternatives=(("review", "Save active work and confirm the host first."),),\n ),\n SemanticRule(\n rule_id="process.service",\n action_kind="process_stop",\n executables=_PROCESS_EXECUTABLES,\n headline="Stop or change a running process or service",\n summary="{actor} wants to control {target}.",\n impact="Applications, background services, or recurring jobs may stop working or become unavailable.",\n recommendation="Confirm the exact process, service, or job and use the narrowest action.",\n target_strategy="process",\n confidence="derived",\n consequence_level="high",\n safer_alternatives=(("preview", "Identify the exact running process or service first."), ("narrow", "Target only the intended process or service.")),\n ),\n SemanticRule(\n rule_id="git.remote_rewrite",\n action_kind="git_remote_change",\n executables=_GIT_EXECUTABLES,\n required_tokens=(frozenset({"push"}), frozenset({"--force", "-f", "--force-with-lease", "--delete"})),\n headline="Rewrite or delete shared Git history",\n summary="{actor} wants to change shared repository history involving {target}.",\n impact="Other collaborators can lose commits or need to repair their local branches.",\n recommendation="Review the remote and branch, preserve a backup ref, and prefer force-with-lease when rewriting is intentional.",\n target_strategy="git",\n confidence="exact",\n consequence_level="high",\n safer_alternatives=(("backup", "Create a backup branch or tag first."), ("narrow", "Prefer force-with-lease over an unconditional force push.")),\n ),\n SemanticRule(\n rule_id="git.remote_change",\n action_kind="git_remote_change",\n executables=_GIT_EXECUTABLES,\n required_tokens=(frozenset({"remote", "push", "fetch"}), frozenset({"set-url", "remove", "rename", "--delete"})),\n headline="Change a Git remote or shared reference",\n summary="{actor} wants to change {target}.",\n impact="Future pushes, fetches, or shared references can point somewhere different or disappear.",\n recommendation="Confirm the remote repository and reference before continuing.",\n target_strategy="git",\n confidence="derived",\n consequence_level="high",\n safer_alternatives=(("preview", "List remotes and references first."),),\n ),\n SemanticRule(\n rule_id="git.local_destructive",\n action_kind="git_history_rewrite",\n executables=_GIT_EXECUTABLES,\n required_tokens=(frozenset({"reset", "clean", "restore", "checkout", "rebase", "branch"}),),\n headline="Discard or rewrite local Git work",\n summary="{actor} wants to change local repository history involving {target}.",\n impact="Uncommitted files, staged work, local commits, or branches can be lost.",\n recommendation="Inspect the changes first and create a stash or backup branch when anything must be preserved.",\n target_strategy="git",\n confidence="derived",\n consequence_level="high",\n safer_alternatives=(("preview", "Review Git status and the affected commits first."), ("backup", "Stash changes or create a backup branch.")),\n ),\n SemanticRule(\n rule_id="package.script",\n action_kind="package_script",\n executables=_PACKAGE_SCRIPT_EXECUTABLES,\n required_tokens=(frozenset({"run", "run-script", "exec", "x", "dlx", "postinstall", "prepare", "prepublish", "build"}),),\n headline="Run a project or package script",\n summary="{actor} wants to run {target}.",\n impact="The script can change files, start processes, contact the network, or run code from installed dependencies.",\n recommendation="Inspect the script definition and run only the narrowest expected target.",\n target_strategy="package_script",\n confidence="derived",\n consequence_level="medium",\n safer_alternatives=(("preview", "Inspect the script definition before running it."), ("narrow", "Run only the specific expected script.")),\n ),\n SemanticRule(\n rule_id="container.privileged",\n action_kind="container_change",\n executables=_CONTAINER_EXECUTABLES,\n required_tokens=(frozenset({"run", "create"}), frozenset({"--privileged", "--pid=host", "--network=host", "--mount", "-v", "--volume"})),\n headline="Run a container with broad host access",\n summary="{actor} wants to run {target} with access that can reach parts of this computer.",\n impact="The container may be able to read secrets, modify host files, or expose services beyond the container boundary.",\n recommendation="Use a pinned image, read-only filesystem, and the narrowest mounts and capabilities possible.",\n target_strategy="container",\n confidence="derived",\n consequence_level="high",\n safer_alternatives=(("isolate", "Use a read-only filesystem and narrow mounts."), ("narrow", "Remove privileged or host-wide access when it is not required.")),\n ),\n SemanticRule(\n rule_id="container.destructive",\n action_kind="container_change",\n executables=_CONTAINER_EXECUTABLES,\n required_tokens=(frozenset({"rm", "prune", "system", "volume", "network"}),),\n headline="Delete or reconfigure container data",\n summary="{actor} wants to change {target}.",\n impact="Containers, images, volumes, networks, or cached data may be removed and may not be recoverable.",\n recommendation="Preview affected container resources before deleting them.",\n target_strategy="container",\n confidence="derived",\n consequence_level="high",\n safer_alternatives=(("preview", "List the affected containers, images, volumes, and networks first."),),\n ),\n SemanticRule(\n rule_id="container.change",\n action_kind="container_change",\n executables=_CONTAINER_EXECUTABLES,\n required_tokens=(frozenset({"run", "create", "exec", "start", "stop", "restart", "pull", "build"}),),\n headline="Run or change a container workload",\n summary="{actor} wants to change {target}.",\n impact="Containerized code can change files, processes, networks, and data available to the container.",\n recommendation="Confirm the image, command, mounts, and network access before continuing.",\n target_strategy="container",\n confidence="derived",\n consequence_level="medium",\n safer_alternatives=(("narrow", "Use a pinned image and the narrowest permissions."),),\n ),\n'''
rule_anchor = 'SEMANTIC_RULES: tuple[SemanticRule, ...] = (\n'
if 'rule_id="system.disk_destructive"' not in text:
text = text.replace(rule_anchor, rule_anchor + rules)

target_anchor = ' if strategy == "filesystem":\n'
strategies = ''' if strategy == "system":\n positional = _positionals(arguments)\n label = _safe_basename(positional[-1]) if positional else "this computer"\n return (f"the system target {label}" if positional else "this computer", "system_target", "normal")\n if strategy == "process":\n positional = _positionals(arguments)\n label = _safe_basename(positional[-1]) if positional else "a running process or service"\n return (f"the process or service {label}" if positional else label, "process_or_service", "normal")\n if strategy == "git":\n positional = _positionals(arguments)\n verbs = {"push", "fetch", "remote", "set-url", "remove", "rename", "reset", "clean", "restore", "checkout", "rebase", "branch"}\n candidates = [value for value in positional if value.casefold() not in verbs]\n label = _safe_basename(candidates[-1]) if candidates else "the current repository"\n return (f"the Git target {label}" if candidates else label, "git_reference", "normal")\n if strategy == "package_script":\n positional = _positionals(arguments)\n verbs = {"run", "run-script", "exec", "x", "dlx"}\n candidates = [value for value in positional if value.casefold() not in verbs]\n label = _safe_basename(candidates[0]) if candidates else "a project script"\n return (f"the script {label}" if candidates else label, "package_script", "normal")\n if strategy == "container":\n positional = _positionals(arguments)\n verbs = {"run", "create", "exec", "start", "stop", "restart", "pull", "build", "rm", "prune", "system", "volume", "network"}\n candidates = [value for value in positional if value.casefold() not in verbs]\n label = _safe_basename(candidates[0]) if candidates else "container resources"\n return (f"the container target {label}" if candidates else label, "container", "normal")\n'''
if 'if strategy == "system"' not in text:
text = text.replace(target_anchor, strategies + target_anchor)
runtime.write_text(text)

builder = Path('src/codex_plugin_scanner/guard/runtime/action_explanation_builder.py')
text = builder.read_text()
anchor = ' material = [step for step in step_explanations if step.kind != "unknown_action"]\n'
detection = ''' shell_runners = {"sh", "bash", "zsh", "fish", "pwsh", "powershell", "cmd", "python", "python3", "node"}\n download_and_execute = bool(\n step_explanations\n and step_explanations[0].kind in {"network_read", "download"}\n and any(str(segment.executable or "").casefold() in shell_runners for segment in command.segments[1:])\n )\n'''
if 'download_and_execute = bool(' not in text:
text = text.replace(anchor, detection + anchor)
text = text.replace(' headline = f"Review {len(command.segments)} ordered actions"\n', ' headline = ("Download a script and run it immediately" if download_and_execute else f"Review {len(command.segments)} ordered actions")\n')
text = text.replace(' summary = f"{facts.actor_label} wants to run several actions in order"\n', ' summary = (f"{facts.actor_label} wants to download content from the internet and pass it directly to a local interpreter" if download_and_execute else f"{facts.actor_label} wants to run several actions in order")\n')
text = text.replace(' "kind": "compound_action",\n', ' "kind": "download_and_execute" if download_and_execute else "compound_action",\n')
text = text.replace(' "impact": "Later steps can hide destructive or external side effects, so review each material action in order.",\n', ' "impact": ("Downloaded code would immediately gain the local capabilities of the interpreter without a separate inspection step." if download_and_execute else "Later steps can hide destructive or external side effects, so review each material action in order."),\n')
text = text.replace(' "recommendation": "Split the command into reviewable steps when possible and confirm each material action before running it.",\n', ' "recommendation": ("Download the content first, inspect and pin it, then run the reviewed file separately." if download_and_execute else "Split the command into reviewable steps when possible and confirm each material action before running it."),\n')
builder.write_text(text)

tests = Path('tests/test_guard_everyday_semantic_201_300.py')
tests.write_text('''from __future__ import annotations\n\nimport pytest\n\nfrom codex_plugin_scanner.guard.runtime.action_explanation_builder import build_action_explanation\nfrom codex_plugin_scanner.guard.runtime.command_model import parse_shell_command\n\n\n@pytest.mark.parametrize(\n ("command", "kind", "headline"),\n [\n ("cp -f draft.txt final.txt", "file_write", "Copy files"),\n ("chmod -R 755 ./project", "permission_change", "Change who can access"),\n ("format C: /Q", "disk_change", "storage drive"),\n ("shutdown /s", "system_change", "power state"),\n ("taskkill /PID 1234 /F", "process_stop", "process or service"),\n ("git reset --hard HEAD~1", "git_history_rewrite", "local Git work"),\n ("git push --force origin main", "git_remote_change", "shared Git history"),\n ("curl -o tool.sh https://example.test/tool.sh", "download", "Download a file"),\n ("curl https://example.test/install.sh | sh", "download_and_execute", "Download a script"),\n ("cat ~/.aws/credentials", "secret_read", "saved credentials"),\n ("curl --data @report.txt https://upload.example/ingest", "network_send", "Send data"),\n ("npm install react@19", "package_install", "Install software"),\n ("npm run build", "package_script", "project or package script"),\n ("docker system prune -a", "container_change", "container data"),\n ("docker run --privileged alpine sh", "container_change", "broad host access"),\n ],\n)\ndef test_evm_201_300_semantic_matrix(command: str, kind: str, headline: str) -> None:\n canonical = parse_shell_command(command)\n explanation = build_action_explanation(\n action_envelope={"action_type": "shell_command", "command": command},\n action_identity=f"evm:{kind}",\n actor_label="Cursor",\n canonical_command=canonical,\n )\n assert explanation.kind == kind\n assert headline.casefold() in explanation.everyday.headline.casefold()\n assert explanation.everyday.consequences\n assert explanation.everyday.safer_alternatives\n assert explanation.technical.command_display is None\n\n\ndef test_download_and_execute_retains_identity_and_exact_details_only_when_authorized() -> None:\n command = "curl https://example.test/install.sh | sh"\n canonical = parse_shell_command(command)\n hidden = build_action_explanation(\n action_envelope={"action_type": "shell_command", "command": command},\n action_identity="evm:download-exec",\n actor_label="Cursor",\n canonical_command=canonical,\n )\n visible = build_action_explanation(\n action_envelope={"action_type": "shell_command", "command": command},\n action_identity="evm:download-exec",\n actor_label="Cursor",\n canonical_command=canonical,\n exact_details_authorized=True,\n )\n assert hidden.action_identity == visible.action_identity\n assert hidden.canonical_identity == visible.canonical_identity == canonical.security_identity\n assert hidden.technical.command_display is None\n assert visible.technical.command_display == command\n''')

dash = Path('dashboard/src/everyday-semantic-201-300.test.tsx')
dash.write_text('''import assert from "node:assert/strict";\nimport { renderToStaticMarkup } from "react-dom/server";\nimport { ActionExplanation } from "./action-explanation";\nimport { PresentationModeProvider } from "./presentation-mode-provider";\nimport { resolvePresentationMode } from "./presentation-mode";\nimport type { GuardActionExplanationV1, GuardEverydayActionKind } from "./guard-types";\n\nfunction explanation(kind: GuardEverydayActionKind, headline: string): GuardActionExplanationV1 {\n return {\n schema_version: "guard.action-explanation.v1", explanation_version: "1.0.0", renderer_version: "1.0.0",\n action_identity: `evm:${kind}`, canonical_identity: `canonical:${kind}`, catalog_digest: "a".repeat(64), locale: "en-US",\n kind, confidence: "derived", uncertainty_reasons: [],\n everyday: { headline_message_id: `guard.everyday.${kind}.headline`, headline, summary_message_id: `guard.everyday.${kind}.summary`, summary: headline, impact_message_id: `guard.everyday.${kind}.impact`, impact: "Material impact", why_guard_intervened_message_id: null, why_guard_intervened: null, recommendation_message_id: `guard.everyday.${kind}.recommendation`, recommendation: "Review first", actor_label: "Cursor", targets: [{ kind: "target", label: "safe target", scope: null, sensitivity: "normal" }], consequences: [{ message_id: "impact", message: "Material impact", severity: "high", confirmed: false }], safer_alternatives: [{ message_id: "safer", message: "Review first", kind: "preview" }] },\n technical: { available: true, unavailable_reason: null, action_type: kind, command_display: "technical command", normalized_command_display: "technical command", executable: null, arguments_display: null, dialect: "posix", transport: "shell_string", working_scope_display: null, wrappers: [], segments: [], extension_ids: [], rule_ids: [], reason_codes: [], policy_source: null, parse_confidence: "exact", proof_level: null, receipt_id: null, action_id: `evm:${kind}` },\n redaction: { level: "none", policy_version: "1", omitted_fields: [], truncated_fields: [], secret_like_values_removed: false },\n };\n}\n\nfor (const [kind, headline] of [["disk_change", "Erase a storage drive"], ["process_stop", "Stop a service"], ["git_history_rewrite", "Discard local Git work"], ["git_remote_change", "Rewrite shared Git history"], ["download_and_execute", "Download and run a script"], ["package_script", "Run a project script"], ["container_change", "Change a container"]] as const) {\n for (const mode of ["everyday", "technical"] as const) {\n const resolved = resolvePresentationMode({ value: mode, explicit: true, schemaVersion: 1, revision: 1 });\n const markup = renderToStaticMarkup(<PresentationModeProvider initialResolved={resolved} loadFromCore={false}><ActionExplanation explanation={explanation(kind, headline)} actionIdentity={`evm:${kind}`} canonicalIdentity={`canonical:${kind}`} /></PresentationModeProvider>);\n assert.match(markup, new RegExp(headline));\n assert.match(markup, new RegExp(`data-action-identity=\\"evm:${kind}\\"`));\n assert.match(markup, /technical command/);\n }\n}\n''')

package = Path('dashboard/package.json')
payload = json.loads(package.read_text())
test = payload['scripts']['test']
cmd = 'tsx src/everyday-semantic-201-300.test.tsx'
if cmd not in test:
payload['scripts']['test'] = cmd + ' && ' + test
package.write_text(json.dumps(payload, indent=2) + '\n')

doc = Path('docs/guard/everyday-mode/semantic-coverage-201-300.md')
doc.parent.mkdir(parents=True, exist_ok=True)
doc.write_text('''# Everyday Mode semantic coverage: EVM-201-300\n\nThe Core semantic catalog covers file overwrite/move, permissions and ownership, disk and power operations, process/service control, local and remote Git history, network download, download-and-execute, secret reads, data upload/exfiltration, package installation, package scripts, and container actions.\n\nFor every family, the implementation is deterministic and side-effect free, uses the canonical Core action model, selects a safe target label, describes material consequences, provides bounded safer alternatives, falls back to limited confidence when unsupported, and keeps exact evidence behind retention and authorization. The dashboard renders the shared versioned contract in both Everyday and Technical modes and does not parse commands.\n\nAdversarial coverage includes flags after operands, redacted secret payloads, remote targets, destructive Git history changes, download-to-interpreter pipelines, broad container host access, and exact-detail visibility boundaries.\n''')
PY
- name: Clean branch scaffolding
run: |
rm -f docs/guard/everyday-mode/.batch-101-200-review-fixes docs/guard/everyday-mode/.batch-201-300-base docs/guard/everyday-mode/.branch-201-300 docs/guard/everyday-mode/.branch-201-300-ready docs/guard/everyday-mode/.stack-marker docs/guard/everyday-mode/.e201 docs/guard/everyday-mode/.final-stack-point
- name: Set up Python and uv
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: '3.12'
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39
with:
version: '0.9.26'
- name: Validate Core semantics
run: |
set -euo pipefail
uv sync --frozen --extra dev --python 3.12
uv run --no-sync pytest -q tests/test_guard_semantic_explanations.py tests/test_guard_action_explanation_builder.py tests/test_guard_everyday_semantic_201_300.py
uv run --no-sync ruff check src/codex_plugin_scanner/guard/runtime/semantic_explanations.py src/codex_plugin_scanner/guard/runtime/action_explanation_builder.py tests/test_guard_everyday_semantic_201_300.py
uv run --no-sync python tests/guard_command_decision_diff.py --write
uv run --no-sync python tests/guard_command_decision_diff.py --check
uv run --no-sync python scripts/ci/test_inventory.py --output test-inventory.json
uv run --no-sync python scripts/ci/test_suite_ratchet.py --baseline ci/test-suite-ratchet-baseline.json --inventory test-inventory.json || uv run --no-sync python scripts/ci/test_suite_ratchet.py --baseline ci/test-suite-ratchet-baseline.json --inventory test-inventory.json --write-baseline
uv run --no-sync python scripts/ci/code_quality_audit.py --root . --baseline ci/code-quality-baseline.json --write-baseline --json-output code-quality-audit.json
uv run --no-sync python scripts/ci/code_quality_audit.py --root . --baseline ci/code-quality-baseline.json --json-output code-quality-audit.json
- name: Set up Bun and validate dashboard
uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76
with:
bun-version: '1.2.22'
- working-directory: dashboard
run: |
bun install --frozen-lockfile
bun run test
bun run build
- name: Remove workflow and push
run: |
set -euo pipefail
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git rm .github/workflows/everyday-mode-implement-201-300.yml
git add -A
git commit -m "feat: expand Everyday semantic coverage EVM 201-300"
git push origin HEAD:feat/everyday-mode-201-300

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.

Medium: Self-mutating implement workflow with contents:write and branch push is still on the PR and never finished its job.

everyday-mode-implement-201-300.yml runs on push to feat/everyday-mode-201-300, requests contents: write, checks out with persist-credentials: true, rewrites source via an embedded Python heredoc, then git commits and git push origin HEAD:feat/everyday-mode-201-300 before deleting itself. That automation never produced the promised source changes, so the workflow remains as a write-capable branch-mutating job. Any further push by a non-bot actor can rewrite the feature branch from CI, and reviewers cannot see the intended EVM-201–300 diffs in the PR. Remove the workflow and commit the semantic/UI/test changes as ordinary reviewed commits instead of generating them from a write-token job.

Open in Capy Review

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (27) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Missing presentation mode module 🐞 Bug ≡ Correctness ⭐ New
Description
The production entry point mounts the new provider, which imports an absent ./presentation-mode
module, while the explanation component imports a nonexistent GuardActionExplanationV1 type. These
unresolved imports cause the dashboard build to fail module resolution before the application can
render.
Code

dashboard/src/presentation-mode-provider.tsx[R12-15]

+import {
+  PRESENTATION_SCHEMA_VERSION,
+  resolvePresentationMode,
+  type GuardPresentationMode,
Evidence
main.tsx imports and mounts PresentationModeProvider, whose unconditional ./presentation-mode
import is therefore reached by Vite rather than deferred until the explanation component is
rendered. The checked-out dashboard/src contains only presentation-mode-provider.tsx, with no
presentation-mode.ts or .tsx, and guard-types.ts contains no GuardActionExplanationV1
declaration, confirming that both imports target missing definitions.

dashboard/src/main.tsx[4-21]
dashboard/src/presentation-mode-provider.tsx[11-18]
dashboard/src/action-explanation.tsx[3-5]
dashboard/src/main.tsx[17-22]
dashboard/src/guard-types.ts[1-80]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Implement and export the missing presentation-mode module and action-explanation TypeScript contract, or update the imports to the repository's authoritative equivalents, so the production dashboard build resolves all imports.

## Issue Context
`main.tsx` now mounts `PresentationModeProvider`, so Vite always reaches its unresolved `./presentation-mode` import. Add the resolver, constants, types, and disclosure helper expected by the provider and action explanation component, including the missing `GuardActionExplanationV1` contract, or point those consumers to existing authoritative definitions.

## Fix Focus Areas
- dashboard/src/presentation-mode-provider.tsx[11-18]
- dashboard/src/action-explanation.tsx[3-5]
- dashboard/src/main.tsx[4-5]
- dashboard/src/main.tsx[19-21]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Missing dashboard contract types 🐞 Bug ≡ Correctness ⭐ New
Description
action-explanation.tsx and its new test import GuardActionExplanationV1 from guard-types.ts,
but that type and the related Everyday action kinds are not defined there, so the generated
dashboard semantic test cannot type-check or run even after the missing presentation module is
restored.
Code

dashboard/src/action-explanation.tsx[R3-4]

+import type { GuardActionExplanationV1 } from "./guard-types";
+import { defaultTechnicalDisclosure } from "./presentation-mode";
Evidence
The component requires GuardActionExplanationV1, and the workflow-generated test additionally
requires GuardEverydayActionKind; repository search finds neither declaration in
dashboard/src/guard-types.ts.

dashboard/src/action-explanation.tsx[1-5]
.github/workflows/everyday-mode-implement-201-300.yml[68-69]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new dashboard component imports explanation contract types that are absent from the shared type module.

## Issue Context
Define the versioned explanation structure and Everyday action-kind union used by the component and generated tests, keeping them aligned with the Core contract.

## Fix Focus Areas
- dashboard/src/action-explanation.tsx[3-4]
- dashboard/src/guard-types.ts[1-1]
- .github/workflows/everyday-mode-implement-201-300.yml[68-69]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Write token exposed to branch 🐞 Bug ⛨ Security ⭐ New
Description
The implementation job grants contents: write, persists that credential in the checkout, and then
executes branch-controlled Python tests and dependency/build scripts for every non-bot push. A
modified commit or dependency lifecycle script can use the repository-wide workflow token to push
arbitrary content beyond the intended generated commit.
Code

.github/workflows/everyday-mode-implement-201-300.yml[R21-25]

+      - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10
+        with:
+          ref: feat/everyday-mode-201-300
+          fetch-depth: 0
+          persist-credentials: true
Evidence
The workflow triggers on branch pushes from every actor except the Actions bot, checks out with
persisted credentials under contents: write, and later runs project-controlled uv/Bun install,
test, and build commands before pushing.

.github/workflows/everyday-mode-implement-201-300.yml[3-9]
.github/workflows/everyday-mode-implement-201-300.yml[17-25]
.github/workflows/everyday-mode-implement-201-300.yml[93-113]
.github/workflows/everyday-mode-implement-201-300.yml[114-122]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Untrusted branch content executes while a write-capable GitHub token is persisted in the checkout.

## Issue Context
Run generation and validation with read-only permissions and no persisted credentials. Perform any final push in a narrowly scoped, protected job after validation, using an explicit credential and immutable reviewed inputs.

## Fix Focus Areas
- .github/workflows/everyday-mode-implement-201-300.yml[8-9]
- .github/workflows/everyday-mode-implement-201-300.yml[17-25]
- .github/workflows/everyday-mode-implement-201-300.yml[93-122]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View high (18)
4. CI failures rewrite baselines 🐞 Bug ☼ Reliability ⭐ New
Description
The validation step converts a test-suite ratchet failure into a baseline update and unconditionally
rewrites the code-quality baseline before checking it. Regressions detected by either ratchet are
therefore normalized and committed instead of failing the implementation job.
Code

.github/workflows/everyday-mode-implement-201-300.yml[R102-104]

+          uv run --no-sync python scripts/ci/test_suite_ratchet.py --baseline ci/test-suite-ratchet-baseline.json --inventory test-inventory.json || uv run --no-sync python scripts/ci/test_suite_ratchet.py --baseline ci/test-suite-ratchet-baseline.json --inventory test-inventory.json --write-baseline
+          uv run --no-sync python scripts/ci/code_quality_audit.py --root . --baseline ci/code-quality-baseline.json --write-baseline --json-output code-quality-audit.json
+          uv run --no-sync python scripts/ci/code_quality_audit.py --root . --baseline ci/code-quality-baseline.json --json-output code-quality-audit.json
Evidence
Line 102 invokes --write-baseline after any failed ratchet check, while line 103 always writes the
code-quality baseline immediately before checking it; the final git add -A commits those rewritten
files.

.github/workflows/everyday-mode-implement-201-300.yml[99-104]
.github/workflows/everyday-mode-implement-201-300.yml[114-122]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Validation updates quality baselines when checks fail, allowing regressions to pass and become the new accepted state.

## Issue Context
CI should run ratchets in check-only mode. Baseline changes must be deliberate reviewed source changes, not automatic failure recovery.

## Fix Focus Areas
- .github/workflows/everyday-mode-implement-201-300.yml[101-104]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. Disk formatting labeled power change 🐞 Bug ≡ Correctness ⭐ New
Description
The generated disk rule requires a destructive token in the arguments even though mkfs is normally
the executable, while the following power rule matches every _SYSTEM_EXECUTABLES member without
token constraints. Consequently mkfs /dev/sda1 misses system.disk_destructive and is presented
as changing the computer's power state.
Code

.github/workflows/everyday-mode-implement-201-300.yml[41]

+          rules = '''    SemanticRule(\n        rule_id="system.disk_destructive",\n        action_kind="disk_change",\n        executables=_SYSTEM_EXECUTABLES,\n        required_tokens=(frozenset({"format", "clean", "create", "delete", "mkfs", "--all", "/q"}),),\n        headline="Erase or reconfigure a storage drive",\n        summary="{actor} wants to make a destructive storage change involving {target}.",\n        impact="Files on the affected drive or partition can be permanently lost and the system may become unusable.",\n        recommendation="Confirm the exact drive or partition and make sure required data is backed up.",\n        target_strategy="system",\n        confidence="derived",\n        consequence_level="critical",\n        safer_alternatives=(("preview", "List the exact drive or partition first."), ("backup", "Back up important data before changing storage.")),\n    ),\n    SemanticRule(\n        rule_id="system.power",\n        action_kind="system_change",\n        executables=_SYSTEM_EXECUTABLES,\n        headline="Change this computer's power state",\n        summary="{actor} wants to shut down, restart, halt, or otherwise change {target}.",\n        impact="Running work can be interrupted and unsaved changes may be lost.",\n        recommendation="Confirm that stopping or restarting this computer is expected.",\n        target_strategy="system",\n        confidence="derived",\n        consequence_level="high",\n        safer_alternatives=(("review", "Save active work and confirm the host first."),),\n    ),\n    SemanticRule(\n        rule_id="process.service",\n        action_kind="process_stop",\n        executables=_PROCESS_EXECUTABLES,\n        headline="Stop or change a running process or service",\n        summary="{actor} wants to control {target}.",\n        impact="Applications, background services, or recurring jobs may stop working or become unavailable.",\n        recommendation="Confirm the exact process, service, or job and use the narrowest action.",\n        target_strategy="process",\n        confidence="derived",\n        consequence_level="high",\n        safer_alternatives=(("preview", "Identify the exact running process or service first."), ("narrow", "Target only the intended process or service.")),\n    ),\n    SemanticRule(\n        rule_id="git.remote_rewrite",\n        action_kind="git_remote_change",\n        executables=_GIT_EXECUTABLES,\n        required_tokens=(frozenset({"push"}), frozenset({"--force", "-f", "--force-with-lease", "--delete"})),\n        headline="Rewrite or delete shared Git history",\n        summary="{actor} wants to change shared repository history involving {target}.",\n        impact="Other collaborators can lose commits or need to repair their local branches.",\n        recommendation="Review the remote and branch, preserve a backup ref, and prefer force-with-lease when rewriting is intentional.",\n        target_strategy="git",\n        confidence="exact",\n        consequence_level="high",\n        safer_alternatives=(("backup", "Create a backup branch or tag first."), ("narrow", "Prefer force-with-lease over an unconditional force push.")),\n    ),\n    SemanticRule(\n        rule_id="git.remote_change",\n        action_kind="git_remote_change",\n        executables=_GIT_EXECUTABLES,\n        required_tokens=(frozenset({"remote", "push", "fetch"}), frozenset({"set-url", "remove", "rename", "--delete"})),\n        headline="Change a Git remote or shared reference",\n        summary="{actor} wants to change {target}.",\n        impact="Future pushes, fetches, or shared references can point somewhere different or disappear.",\n        recommendation="Confirm the remote repository and reference before continuing.",\n        target_strategy="git",\n        confidence="derived",\n        consequence_level="high",\n        safer_alternatives=(("preview", "List remotes and references first."),),\n    ),\n    SemanticRule(\n        rule_id="git.local_destructive",\n        action_kind="git_history_rewrite",\n        executables=_GIT_EXECUTABLES,\n        required_tokens=(frozenset({"reset", "clean", "restore", "checkout", "rebase", "branch"}),),\n        headline="Discard or rewrite local Git work",\n        summary="{actor} wants to change local repository history involving {target}.",\n        impact="Uncommitted files, staged work, local commits, or branches can be lost.",\n        recommendation="Inspect the changes first and create a stash or backup branch when anything must be preserved.",\n        target_strategy="git",\n        confidence="derived",\n        consequence_level="high",\n        safer_alternatives=(("preview", "Review Git status and the affected commits first."), ("backup", "Stash changes or create a backup branch.")),\n    ),\n    SemanticRule(\n        rule_id="package.script",\n        action_kind="package_script",\n        executables=_PACKAGE_SCRIPT_EXECUTABLES,\n        required_tokens=(frozenset({"run", "run-script", "exec", "x", "dlx", "postinstall", "prepare", "prepublish", "build"}),),\n        headline="Run a project or package script",\n        summary="{actor} wants to run {target}.",\n        impact="The script can change files, start processes, contact the network, or run code from installed dependencies.",\n        recommendation="Inspect the script definition and run only the narrowest expected target.",\n        target_strategy="package_script",\n        confidence="derived",\n        consequence_level="medium",\n        safer_alternatives=(("preview", "Inspect the script definition before running it."), ("narrow", "Run only the specific expected script.")),\n    ),\n    SemanticRule(\n        rule_id="container.privileged",\n        action_kind="container_change",\n        executables=_CONTAINER_EXECUTABLES,\n        required_tokens=(frozenset({"run", "create"}), frozenset({"--privileged", "--pid=host", "--network=host", "--mount", "-v", "--volume"})),\n        headline="Run a container with broad host access",\n        summary="{actor} wants to run {target} with access that can reach parts of this computer.",\n        impact="The container may be able to read secrets, modify host files, or expose services beyond the container boundary.",\n        recommendation="Use a pinned image, read-only filesystem, and the narrowest mounts and capabilities possible.",\n        target_strategy="container",\n        confidence="derived",\n        consequence_level="high",\n        safer_alternatives=(("isolate", "Use a read-only filesystem and narrow mounts."), ("narrow", "Remove privileged or host-wide access when it is not required.")),\n    ),\n    SemanticRule(\n        rule_id="container.destructive",\n        action_kind="container_change",\n        executables=_CONTAINER_EXECUTABLES,\n        required_tokens=(frozenset({"rm", "prune", "system", "volume", "network"}),),\n        headline="Delete or reconfigure container data",\n        summary="{actor} wants to change {target}.",\n        impact="Containers, images, volumes, networks, or cached data may be removed and may not be recoverable.",\n        recommendation="Preview affected container resources before deleting them.",\n        target_strategy="container",\n        confidence="derived",\n        consequence_level="high",\n        safer_alternatives=(("preview", "List the affected containers, images, volumes, and networks first."),),\n    ),\n    SemanticRule(\n        rule_id="container.change",\n        action_kind="container_change",\n        executables=_CONTAINER_EXECUTABLES,\n        required_tokens=(frozenset({"run", "create", "exec", "start", "stop", "restart", "pull", "build"}),),\n        headline="Run or change a container workload",\n        summary="{actor} wants to change {target}.",\n        impact="Containerized code can change files, processes, networks, and data available to the container.",\n        recommendation="Confirm the image, command, mounts, and network access before continuing.",\n        target_strategy="container",\n        confidence="derived",\n        consequence_level="medium",\n        safer_alternatives=(("narrow", "Use a pinned image and the narrowest permissions."),),\n    ),\n'''
Evidence
The workflow defines _SYSTEM_EXECUTABLES with both formatting and power tools. Its generated disk
rule requires one of several argument tokens including mkfs, but matching tokenization only uses
arguments, and the unconstrained power rule then accepts the same executable set.

.github/workflows/everyday-mode-implement-201-300.yml[34-41]
src/codex_plugin_scanner/guard/runtime/semantic_explanations.py[114-119]
src/codex_plugin_scanner/guard/runtime/semantic_explanations.py[355-364]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The generated rules classify ordinary `mkfs` invocations as power-state changes because disk and power commands share one executable set and the disk matcher expects `mkfs` in argv.

## Issue Context
Use disjoint executable sets or executable-specific matching so formatting tools match the destructive disk rule without requiring their executable name as an argument.

## Fix Focus Areas
- .github/workflows/everyday-mode-implement-201-300.yml[36-41]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


6. Container reads labeled destructive 🐞 Bug ≡ Correctness ⭐ New
Description
The generated destructive container rule matches any command containing system, volume, or
network, regardless of the subcommand. Read-only commands such as docker volume ls, `docker
network inspect, and docker system info` are therefore presented as deleting or reconfiguring
container data with high consequences.
Code

.github/workflows/everyday-mode-implement-201-300.yml[41]

+          rules = '''    SemanticRule(\n        rule_id="system.disk_destructive",\n        action_kind="disk_change",\n        executables=_SYSTEM_EXECUTABLES,\n        required_tokens=(frozenset({"format", "clean", "create", "delete", "mkfs", "--all", "/q"}),),\n        headline="Erase or reconfigure a storage drive",\n        summary="{actor} wants to make a destructive storage change involving {target}.",\n        impact="Files on the affected drive or partition can be permanently lost and the system may become unusable.",\n        recommendation="Confirm the exact drive or partition and make sure required data is backed up.",\n        target_strategy="system",\n        confidence="derived",\n        consequence_level="critical",\n        safer_alternatives=(("preview", "List the exact drive or partition first."), ("backup", "Back up important data before changing storage.")),\n    ),\n    SemanticRule(\n        rule_id="system.power",\n        action_kind="system_change",\n        executables=_SYSTEM_EXECUTABLES,\n        headline="Change this computer's power state",\n        summary="{actor} wants to shut down, restart, halt, or otherwise change {target}.",\n        impact="Running work can be interrupted and unsaved changes may be lost.",\n        recommendation="Confirm that stopping or restarting this computer is expected.",\n        target_strategy="system",\n        confidence="derived",\n        consequence_level="high",\n        safer_alternatives=(("review", "Save active work and confirm the host first."),),\n    ),\n    SemanticRule(\n        rule_id="process.service",\n        action_kind="process_stop",\n        executables=_PROCESS_EXECUTABLES,\n        headline="Stop or change a running process or service",\n        summary="{actor} wants to control {target}.",\n        impact="Applications, background services, or recurring jobs may stop working or become unavailable.",\n        recommendation="Confirm the exact process, service, or job and use the narrowest action.",\n        target_strategy="process",\n        confidence="derived",\n        consequence_level="high",\n        safer_alternatives=(("preview", "Identify the exact running process or service first."), ("narrow", "Target only the intended process or service.")),\n    ),\n    SemanticRule(\n        rule_id="git.remote_rewrite",\n        action_kind="git_remote_change",\n        executables=_GIT_EXECUTABLES,\n        required_tokens=(frozenset({"push"}), frozenset({"--force", "-f", "--force-with-lease", "--delete"})),\n        headline="Rewrite or delete shared Git history",\n        summary="{actor} wants to change shared repository history involving {target}.",\n        impact="Other collaborators can lose commits or need to repair their local branches.",\n        recommendation="Review the remote and branch, preserve a backup ref, and prefer force-with-lease when rewriting is intentional.",\n        target_strategy="git",\n        confidence="exact",\n        consequence_level="high",\n        safer_alternatives=(("backup", "Create a backup branch or tag first."), ("narrow", "Prefer force-with-lease over an unconditional force push.")),\n    ),\n    SemanticRule(\n        rule_id="git.remote_change",\n        action_kind="git_remote_change",\n        executables=_GIT_EXECUTABLES,\n        required_tokens=(frozenset({"remote", "push", "fetch"}), frozenset({"set-url", "remove", "rename", "--delete"})),\n        headline="Change a Git remote or shared reference",\n        summary="{actor} wants to change {target}.",\n        impact="Future pushes, fetches, or shared references can point somewhere different or disappear.",\n        recommendation="Confirm the remote repository and reference before continuing.",\n        target_strategy="git",\n        confidence="derived",\n        consequence_level="high",\n        safer_alternatives=(("preview", "List remotes and references first."),),\n    ),\n    SemanticRule(\n        rule_id="git.local_destructive",\n        action_kind="git_history_rewrite",\n        executables=_GIT_EXECUTABLES,\n        required_tokens=(frozenset({"reset", "clean", "restore", "checkout", "rebase", "branch"}),),\n        headline="Discard or rewrite local Git work",\n        summary="{actor} wants to change local repository history involving {target}.",\n        impact="Uncommitted files, staged work, local commits, or branches can be lost.",\n        recommendation="Inspect the changes first and create a stash or backup branch when anything must be preserved.",\n        target_strategy="git",\n        confidence="derived",\n        consequence_level="high",\n        safer_alternatives=(("preview", "Review Git status and the affected commits first."), ("backup", "Stash changes or create a backup branch.")),\n    ),\n    SemanticRule(\n        rule_id="package.script",\n        action_kind="package_script",\n        executables=_PACKAGE_SCRIPT_EXECUTABLES,\n        required_tokens=(frozenset({"run", "run-script", "exec", "x", "dlx", "postinstall", "prepare", "prepublish", "build"}),),\n        headline="Run a project or package script",\n        summary="{actor} wants to run {target}.",\n        impact="The script can change files, start processes, contact the network, or run code from installed dependencies.",\n        recommendation="Inspect the script definition and run only the narrowest expected target.",\n        target_strategy="package_script",\n        confidence="derived",\n        consequence_level="medium",\n        safer_alternatives=(("preview", "Inspect the script definition before running it."), ("narrow", "Run only the specific expected script.")),\n    ),\n    SemanticRule(\n        rule_id="container.privileged",\n        action_kind="container_change",\n        executables=_CONTAINER_EXECUTABLES,\n        required_tokens=(frozenset({"run", "create"}), frozenset({"--privileged", "--pid=host", "--network=host", "--mount", "-v", "--volume"})),\n        headline="Run a container with broad host access",\n        summary="{actor} wants to run {target} with access that can reach parts of this computer.",\n        impact="The container may be able to read secrets, modify host files, or expose services beyond the container boundary.",\n        recommendation="Use a pinned image, read-only filesystem, and the narrowest mounts and capabilities possible.",\n        target_strategy="container",\n        confidence="derived",\n        consequence_level="high",\n        safer_alternatives=(("isolate", "Use a read-only filesystem and narrow mounts."), ("narrow", "Remove privileged or host-wide access when it is not required.")),\n    ),\n    SemanticRule(\n        rule_id="container.destructive",\n        action_kind="container_change",\n        executables=_CONTAINER_EXECUTABLES,\n        required_tokens=(frozenset({"rm", "prune", "system", "volume", "network"}),),\n        headline="Delete or reconfigure container data",\n        summary="{actor} wants to change {target}.",\n        impact="Containers, images, volumes, networks, or cached data may be removed and may not be recoverable.",\n        recommendation="Preview affected container resources before deleting them.",\n        target_strategy="container",\n        confidence="derived",\n        consequence_level="high",\n        safer_alternatives=(("preview", "List the affected containers, images, volumes, and networks first."),),\n    ),\n    SemanticRule(\n        rule_id="container.change",\n        action_kind="container_change",\n        executables=_CONTAINER_EXECUTABLES,\n        required_tokens=(frozenset({"run", "create", "exec", "start", "stop", "restart", "pull", "build"}),),\n        headline="Run or change a container workload",\n        summary="{actor} wants to change {target}.",\n        impact="Containerized code can change files, processes, networks, and data available to the container.",\n        recommendation="Confirm the image, command, mounts, and network access before continuing.",\n        target_strategy="container",\n        confidence="derived",\n        consequence_level="medium",\n        safer_alternatives=(("narrow", "Use a pinned image and the narrowest permissions."),),\n    ),\n'''
Evidence
The generated rule's sole required token group is {rm, prune, system, volume, network}.
SemanticRule.matches only checks set intersection over all arguments, so any occurrence of the
resource nouns is sufficient to select the destructive headline.

.github/workflows/everyday-mode-implement-201-300.yml[41-41]
src/codex_plugin_scanner/guard/runtime/semantic_explanations.py[114-119]
src/codex_plugin_scanner/guard/runtime/semantic_explanations.py[358-364]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The generated container destructive rule treats resource nouns as destructive actions.

## Issue Context
Require destructive verbs in the correct command structure, such as `rm` or `prune`, and distinguish read-only subcommands like `ls`, `inspect`, and `info`.

## Fix Focus Areas
- .github/workflows/everyday-mode-implement-201-300.yml[41-41]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


7. Sequence mislabeled download execution 🐞 Bug ≡ Correctness ⭐ New
Description
The generated download_and_execute detector checks only that the first segment is a network
read/download and any later segment is an interpreter; it does not check that downloaded output is
piped to that interpreter. Thus curl https://example.test && sh local.sh is falsely described as
passing internet content directly to a local interpreter.
Code

.github/workflows/everyday-mode-implement-201-300.yml[55]

+          detection = '''    shell_runners = {"sh", "bash", "zsh", "fish", "pwsh", "powershell", "cmd", "python", "python3", "node"}\n    download_and_execute = bool(\n        step_explanations\n        and step_explanations[0].kind in {"network_read", "download"}\n        and any(str(segment.executable or "").casefold() in shell_runners for segment in command.segments[1:])\n    )\n'''
Evidence
The inserted boolean only examines the first explanation kind and later executable names. The
compound builder receives canonical segments but the detector has no condition on pipeline indices,
separators, or a source-to-sink relationship.

.github/workflows/everyday-mode-implement-201-300.yml[52-62]
src/codex_plugin_scanner/guard/runtime/action_explanation_builder.py[256-280]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The generated detector conflates ordered commands with download-to-interpreter pipelines.

## Issue Context
Use canonical operator/pipeline metadata to prove that the network command's stdout flows into the interpreter, rather than merely looking for an interpreter in a later segment.

## Fix Focus Areas
- .github/workflows/everyday-mode-implement-201-300.yml[52-62]
- src/codex_plugin_scanner/guard/runtime/action_explanation_builder.py[256-283]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


8. Compound flags become targets 🐞 Bug ≡ Correctness ⭐ New
Description
Compound-step construction copies every segment argument into authoritative operands, bypassing
the option filtering used by semantic fallback extraction. For cd project && rm build -rf,
filesystem target selection prefers those operands and selects the final value, incorrectly
displaying rf/-rf rather than build as the deletion target.
Code

src/codex_plugin_scanner/guard/runtime/action_explanation_builder.py[R269-272]

+                    executable=segment.executable,
+                    arguments=tuple(segment.arguments),
+                    operands=tuple(segment.arguments),
+                    target_paths=facts.target_paths,
Evidence
The compound builder explicitly sets operands=tuple(segment.arguments), so both paths and option
tokens are passed as operands. The filesystem target resolver prioritizes input.operands over
_filesystem_operands and selects the last candidate for rm, while _filesystem_operands would
filter option tokens such as -rf; this proves that the compound path bypasses the intended
filtering and can advertise the flag as the target.

src/codex_plugin_scanner/guard/runtime/action_explanation_builder.py[261-278]
src/codex_plugin_scanner/guard/runtime/semantic_explanations.py[622-637]
src/codex_plugin_scanner/guard/runtime/semantic_explanations.py[653-668]
src/codex_plugin_scanner/guard/runtime/action_explanation_builder.py[262-278]
src/codex_plugin_scanner/guard/runtime/semantic_explanations.py[653-677]
tests/test_guard_action_explanation_builder.py[118-135]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description

Prevent compound explanations from promoting raw option flags into authoritative operands and displaying the wrong filesystem action target.

## Issue Context

Do not populate `operands` directly from raw `segment.arguments`. Pass canonical typed operands when available, derive operands using the same option-filtering logic as the single-command semantic path, or leave them empty so executable-specific fallback filtering runs. The filesystem strategy prioritizes `input.operands` over heuristic parsing and selects the final candidate, so an option placed after a path—such as `-rf` in `rm build -rf`—can otherwise be advertised instead of the actual target.

## Fix Focus Areas

- src/codex_plugin_scanner/guard/runtime/action_explanation_builder.py[269-272]
- src/codex_plugin_scanner/guard/runtime/semantic_explanations.py[622-668]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


9. Explanation UI is never rendered 🐞 Bug ≡ Correctness ⭐ New
Description
The PR mounts PresentationModeProvider around App, but no production dashboard action, approval,
request, receipt, or history surface imports or renders ActionExplanation; only tests reference
it. As a result, the advertised Everyday/Technical explanations—including identity alerts,
consequences, alternatives, and technical disclosure—are unavailable to users.
Code

dashboard/src/main.tsx[R19-21]

+    <PresentationModeProvider>
+      <App />
+    </PresentationModeProvider>
Evidence
The production entry point only adds PresentationModeProvider, which supplies state but does not
render the explanation UI. Repository references to ActionExplanation are limited to its
definition and static-markup test, while App has no import or render call, proving that no
production path displays the component.

dashboard/src/main.tsx[16-22]
dashboard/src/action-explanation.tsx[154-187]
dashboard/src/app.tsx[1-27]
dashboard/src/main.tsx[17-22]
dashboard/src/action-explanation.tsx[154-189]
dashboard/src/action-explanation.test.tsx[4-7]
dashboard/src/action-explanation.test.tsx[87-95]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Integrate `ActionExplanation` into the production approval, request, receipt, action-detail, or history surfaces that receive Guard action explanations so the Everyday/Technical presentation and identity-mismatch protection are available to users.

## Issue Context
The production change currently only wraps `App` in `PresentationModeProvider`; the provider supplies state but does not render the explanation component. Add the explanation contract to the relevant API payloads, then render `ActionExplanation` with the current action and canonical identities. The only currently observed component usage is in the new static-markup test.

## Fix Focus Areas
- dashboard/src/main.tsx[19-21]
- dashboard/src/action-explanation.tsx[154-187]
- dashboard/src/app.tsx[1-27]
- dashboard/src/action-explanation.test.tsx[87-95]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


10. Missing Python explanation contract 🐞 Bug ≡ Correctness ⭐ New
Description
Both new Python explanation runtime modules import .action_explanation_contract, but that module
does not exist in the repository. Importing the builder or semantic renderer therefore raises
ModuleNotFoundError, preventing the new runtime from loading and causing its tests to fail before
collection completes.
Code

src/codex_plugin_scanner/guard/runtime/action_explanation_builder.py[R18-21]

+from .action_explanation_contract import (
+    ACTION_EXPLANATION_REDACTION_VERSION,
+    ACTION_EXPLANATION_RENDERER_VERSION,
+    GuardActionExplanationV1,
Evidence
The builder and semantic renderer both unconditionally import .action_explanation_contract, yet
the runtime directory contains no matching module and these are the repository's only references to
it. Because the parser, models, constants, and action-kind definitions are required throughout both
code paths—including calls to parse_action_explanation—this is an import-time blocker rather than
unused code.

src/codex_plugin_scanner/guard/runtime/action_explanation_builder.py[18-23]
src/codex_plugin_scanner/guard/runtime/semantic_explanations.py[19-27]
src/codex_plugin_scanner/guard/runtime/semantic_explanations.py[417-484]
src/codex_plugin_scanner/guard/runtime/action_explanation_builder.py[18-28]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Add the missing Python action-explanation contract module, or redirect the imports to the existing authoritative equivalent. The builder and semantic renderer must be importable, able to validate their generated payloads, and no longer cause tests to fail before collection completes.

## Issue Context
Both newly added runtime modules unconditionally import the absent contract and use its parser while building explanations. Provide the versioned models, constants, parser, and action-kind definitions consumed by both modules, or change the imports to an existing equivalent contract.

## Fix Focus Areas
- src/codex_plugin_scanner/guard/runtime/action_explanation_builder.py[18-23]
- src/codex_plugin_scanner/guard/runtime/semantic_explanations.py[19-27]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


11. Python contract module missing 🐞 Bug ≡ Correctness
Description
Both new runtime modules import action_explanation_contract, but that module is absent from the PR
branch, so importing either module raises ModuleNotFoundError and the workflow's pytest validation
cannot run. This prevents all new Core explanation functionality from loading.
Code

src/codex_plugin_scanner/guard/runtime/action_explanation_builder.py[R18-23]

+from .action_explanation_contract import (
+    ACTION_EXPLANATION_REDACTION_VERSION,
+    ACTION_EXPLANATION_RENDERER_VERSION,
+    GuardActionExplanationV1,
+    parse_action_explanation,
+)
Relevance

●●● Strong

Import-time missing dependencies are treated as correctness blockers; similar runtime import
failures were accepted.

PR-#237

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The builder and semantic catalog both unconditionally import the missing module and depend on its
types/constants throughout their public entry points; the workflow explicitly imports these modules
during pytest.

src/codex_plugin_scanner/guard/runtime/action_explanation_builder.py[18-29]
src/codex_plugin_scanner/guard/runtime/semantic_explanations.py[19-27]
.github/workflows/everyday-mode-implement-201-300.yml[93-98]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new explanation runtime imports a contract module that is not present, so tests and runtime imports fail.
## Issue Context
Provide the contract classes, constants, parser, and action-kind definitions consumed by both new runtime modules.
## Fix Focus Areas
- src/codex_plugin_scanner/guard/runtime/action_explanation_builder.py[18-23]
- src/codex_plugin_scanner/guard/runtime/semantic_explanations.py[19-27]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


12. Disk commands become power changes 🐞 Bug ≡ Correctness
Description
The generated disk rule requires an argument token such as format or mkfs, even though those
values are normally the executable, and the following tokenless power rule uses the same executable
set. As a result, commands such as mkfs /dev/sda and format C: miss the disk rule and are
confidently described as changing the computer's power state.
Code

.github/workflows/everyday-mode-implement-201-300.yml[41]

+          rules = '''    SemanticRule(\n        rule_id="system.disk_destructive",\n        action_kind="disk_change",\n        executables=_SYSTEM_EXECUTABLES,\n        required_tokens=(frozenset({"format", "clean", "create", "delete", "mkfs", "--all", "/q"}),),\n        headline="Erase or reconfigure a storage drive",\n        summary="{actor} wants to make a destructive storage change involving {target}.",\n        impact="Files on the affected drive or partition can be permanently lost and the system may become unusable.",\n        recommendation="Confirm the exact drive or partition and make sure required data is backed up.",\n        target_strategy="system",\n        confidence="derived",\n        consequence_level="critical",\n        safer_alternatives=(("preview", "List the exact drive or partition first."), ("backup", "Back up important data before changing storage.")),\n    ),\n    SemanticRule(\n        rule_id="system.power",\n        action_kind="system_change",\n        executables=_SYSTEM_EXECUTABLES,\n        headline="Change this computer's power state",\n        summary="{actor} wants to shut down, restart, halt, or otherwise change {target}.",\n        impact="Running work can be interrupted and unsaved changes may be lost.",\n        recommendation="Confirm that stopping or restarting this computer is expected.",\n        target_strategy="system",\n        confidence="derived",\n        consequence_level="high",\n        safer_alternatives=(("review", "Save active work and confirm the host first."),),\n    ),\n    SemanticRule(\n        rule_id="process.service",\n        action_kind="process_stop",\n        executables=_PROCESS_EXECUTABLES,\n        headline="Stop or change a running process or service",\n        summary="{actor} wants to control {target}.",\n        impact="Applications, background services, or recurring jobs may stop working or become unavailable.",\n        recommendation="Confirm the exact process, service, or job and use the narrowest action.",\n        target_strategy="process",\n        confidence="derived",\n        consequence_level="high",\n        safer_alternatives=(("preview", "Identify the exact running process or service first."), ("narrow", "Target only the intended process or service.")),\n    ),\n    SemanticRule(\n        rule_id="git.remote_rewrite",\n        action_kind="git_remote_change",\n        executables=_GIT_EXECUTABLES,\n        required_tokens=(frozenset({"push"}), frozenset({"--force", "-f", "--force-with-lease", "--delete"})),\n        headline="Rewrite or delete shared Git history",\n        summary="{actor} wants to change shared repository history involving {target}.",\n        impact="Other collaborators can lose commits or need to repair their local branches.",\n        recommendation="Review the remote and branch, preserve a backup ref, and prefer force-with-lease when rewriting is intentional.",\n        target_strategy="git",\n        confidence="exact",\n        consequence_level="high",\n        safer_alternatives=(("backup", "Create a backup branch or tag first."), ("narrow", "Prefer force-with-lease over an unconditional force push.")),\n    ),\n    SemanticRule(\n        rule_id="git.remote_change",\n        action_kind="git_remote_change",\n        executables=_GIT_EXECUTABLES,\n        required_tokens=(frozenset({"remote", "push", "fetch"}), frozenset({"set-url", "remove", "rename", "--delete"})),\n        headline="Change a Git remote or shared reference",\n        summary="{actor} wants to change {target}.",\n        impact="Future pushes, fetches, or shared references can point somewhere different or disappear.",\n        recommendation="Confirm the remote repository and reference before continuing.",\n        target_strategy="git",\n        confidence="derived",\n        consequence_level="high",\n        safer_alternatives=(("preview", "List remotes and references first."),),\n    ),\n    SemanticRule(\n        rule_id="git.local_destructive",\n        action_kind="git_history_rewrite",\n        executables=_GIT_EXECUTABLES,\n        required_tokens=(frozenset({"reset", "clean", "restore", "checkout", "rebase", "branch"}),),\n        headline="Discard or rewrite local Git work",\n        summary="{actor} wants to change local repository history involving {target}.",\n        impact="Uncommitted files, staged work, local commits, or branches can be lost.",\n        recommendation="Inspect the changes first and create a stash or backup branch when anything must be preserved.",\n        target_strategy="git",\n        confidence="derived",\n        consequence_level="high",\n        safer_alternatives=(("preview", "Review Git status and the affected commits first."), ("backup", "Stash changes or create a backup branch.")),\n    ),\n    SemanticRule(\n        rule_id="package.script",\n        action_kind="package_script",\n        executables=_PACKAGE_SCRIPT_EXECUTABLES,\n        required_tokens=(frozenset({"run", "run-script", "exec", "x", "dlx", "postinstall", "prepare", "prepublish", "build"}),),\n        headline="Run a project or package script",\n        summary="{actor} wants to run {target}.",\n        impact="The script can change files, start processes, contact the network, or run code from installed dependencies.",\n        recommendation="Inspect the script definition and run only the narrowest expected target.",\n        target_strategy="package_script",\n        confidence="derived",\n        consequence_level="medium",\n        safer_alternatives=(("preview", "Inspect the script definition before running it."), ("narrow", "Run only the specific expected script.")),\n    ),\n    SemanticRule(\n        rule_id="container.privileged",\n        action_kind="container_change",\n        executables=_CONTAINER_EXECUTABLES,\n        required_tokens=(frozenset({"run", "create"}), frozenset({"--privileged", "--pid=host", "--network=host", "--mount", "-v", "--volume"})),\n        headline="Run a container with broad host access",\n        summary="{actor} wants to run {target} with access that can reach parts of this computer.",\n        impact="The container may be able to read secrets, modify host files, or expose services beyond the container boundary.",\n        recommendation="Use a pinned image, read-only filesystem, and the narrowest mounts and capabilities possible.",\n        target_strategy="container",\n        confidence="derived",\n        consequence_level="high",\n        safer_alternatives=(("isolate", "Use a read-only filesystem and narrow mounts."), ("narrow", "Remove privileged or host-wide access when it is not required.")),\n    ),\n    SemanticRule(\n        rule_id="container.destructive",\n        action_kind="container_change",\n        executables=_CONTAINER_EXECUTABLES,\n        required_tokens=(frozenset({"rm", "prune", "system", "volume", "network"}),),\n        headline="Delete or reconfigure container data",\n        summary="{actor} wants to change {target}.",\n        impact="Containers, images, volumes, networks, or cached data may be removed and may not be recoverable.",\n        recommendation="Preview affected container resources before deleting them.",\n        target_strategy="container",\n        confidence="derived",\n        consequence_level="high",\n        safer_alternatives=(("preview", "List the affected containers, images, volumes, and networks first."),),\n    ),\n    SemanticRule(\n        rule_id="container.change",\n        action_kind="container_change",\n        executables=_CONTAINER_EXECUTABLES,\n        required_tokens=(frozenset({"run", "create", "exec", "start", "stop", "restart", "pull", "build"}),),\n        headline="Run or change a container workload",\n        summary="{actor} wants to change {target}.",\n        impact="Containerized code can change files, processes, networks, and data available to the container.",\n        recommendation="Confirm the image, command, mounts, and network access before continuing.",\n        target_strategy="container",\n        confidence="derived",\n        consequence_level="medium",\n        safer_alternatives=(("narrow", "Use a pinned image and the narrowest permissions."),),\n    ),\n'''
Relevance

●●● Strong

Semantic false-positive and rule-order correctness fixes are consistently accepted when they
misclassify commands.

PR-#225
PR-#398

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The workflow defines one _SYSTEM_EXECUTABLES set containing both disk and power tools. Its disk
rule requires a token group, while its immediately following power rule has no required tokens, and
rule matching selects the first rule whose executable/token conditions pass.

.github/workflows/everyday-mode-implement-201-300.yml[36-41]
src/codex_plugin_scanner/guard/runtime/semantic_explanations.py[114-119]
src/codex_plugin_scanner/guard/runtime/semantic_explanations.py[358-364]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Disk executables fall through to the broad power rule when their arguments lack one of the disk token markers.
## Issue Context
Use distinct executable sets and make destructive disk matching reflect each command's actual grammar.
## Fix Focus Areas
- .github/workflows/everyday-mode-implement-201-300.yml[36-41]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


13. Partial parses appear confident 🐞 Bug ≡ Correctness
Description
When canonical parsing returns only a prefix because the token limit was exceeded, the builder still
classifies that prefix using the rule's normal exact or derived confidence and omits the p...

Comment on lines +12 to +15
import {
PRESENTATION_SCHEMA_VERSION,
resolvePresentationMode,
type GuardPresentationMode,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Missing presentation mode module 🐞 Bug ≡ Correctness

The production entry point mounts the new provider, which imports an absent ./presentation-mode
module, while the explanation component imports a nonexistent GuardActionExplanationV1 type. These
unresolved imports cause the dashboard build to fail module resolution before the application can
render.
Agent Prompt
## Issue description
Implement and export the missing presentation-mode module and action-explanation TypeScript contract, or update the imports to the repository's authoritative equivalents, so the production dashboard build resolves all imports.

## Issue Context
`main.tsx` now mounts `PresentationModeProvider`, so Vite always reaches its unresolved `./presentation-mode` import. Add the resolver, constants, types, and disclosure helper expected by the provider and action explanation component, including the missing `GuardActionExplanationV1` contract, or point those consumers to existing authoritative definitions.

## Fix Focus Areas
- dashboard/src/presentation-mode-provider.tsx[11-18]
- dashboard/src/action-explanation.tsx[3-5]
- dashboard/src/main.tsx[4-5]
- dashboard/src/main.tsx[19-21]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +3 to +4
import type { GuardActionExplanationV1 } from "./guard-types";
import { defaultTechnicalDisclosure } from "./presentation-mode";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

2. Missing dashboard contract types 🐞 Bug ≡ Correctness

action-explanation.tsx and its new test import GuardActionExplanationV1 from guard-types.ts,
but that type and the related Everyday action kinds are not defined there, so the generated
dashboard semantic test cannot type-check or run even after the missing presentation module is
restored.
Agent Prompt
## Issue description
The new dashboard component imports explanation contract types that are absent from the shared type module.

## Issue Context
Define the versioned explanation structure and Everyday action-kind union used by the component and generated tests, keeping them aligned with the Core contract.

## Fix Focus Areas
- dashboard/src/action-explanation.tsx[3-4]
- dashboard/src/guard-types.ts[1-1]
- .github/workflows/everyday-mode-implement-201-300.yml[68-69]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +21 to +25
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10
with:
ref: feat/everyday-mode-201-300
fetch-depth: 0
persist-credentials: true

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

3. Write token exposed to branch 🐞 Bug ⛨ Security

The implementation job grants contents: write, persists that credential in the checkout, and then
executes branch-controlled Python tests and dependency/build scripts for every non-bot push. A
modified commit or dependency lifecycle script can use the repository-wide workflow token to push
arbitrary content beyond the intended generated commit.
Agent Prompt
## Issue description
Untrusted branch content executes while a write-capable GitHub token is persisted in the checkout.

## Issue Context
Run generation and validation with read-only permissions and no persisted credentials. Perform any final push in a narrowly scoped, protected job after validation, using an explicit credential and immutable reviewed inputs.

## Fix Focus Areas
- .github/workflows/everyday-mode-implement-201-300.yml[8-9]
- .github/workflows/everyday-mode-implement-201-300.yml[17-25]
- .github/workflows/everyday-mode-implement-201-300.yml[93-122]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +102 to +104
uv run --no-sync python scripts/ci/test_suite_ratchet.py --baseline ci/test-suite-ratchet-baseline.json --inventory test-inventory.json || uv run --no-sync python scripts/ci/test_suite_ratchet.py --baseline ci/test-suite-ratchet-baseline.json --inventory test-inventory.json --write-baseline
uv run --no-sync python scripts/ci/code_quality_audit.py --root . --baseline ci/code-quality-baseline.json --write-baseline --json-output code-quality-audit.json
uv run --no-sync python scripts/ci/code_quality_audit.py --root . --baseline ci/code-quality-baseline.json --json-output code-quality-audit.json

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

4. Ci failures rewrite baselines 🐞 Bug ☼ Reliability

The validation step converts a test-suite ratchet failure into a baseline update and unconditionally
rewrites the code-quality baseline before checking it. Regressions detected by either ratchet are
therefore normalized and committed instead of failing the implementation job.
Agent Prompt
## Issue description
Validation updates quality baselines when checks fail, allowing regressions to pass and become the new accepted state.

## Issue Context
CI should run ratchets in check-only mode. Baseline changes must be deliberate reviewed source changes, not automatic failure recovery.

## Fix Focus Areas
- .github/workflows/everyday-mode-implement-201-300.yml[101-104]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

if '_SYSTEM_EXECUTABLES' not in text:
text = text.replace(anchor, constants + anchor)

rules = ''' SemanticRule(\n rule_id="system.disk_destructive",\n action_kind="disk_change",\n executables=_SYSTEM_EXECUTABLES,\n required_tokens=(frozenset({"format", "clean", "create", "delete", "mkfs", "--all", "/q"}),),\n headline="Erase or reconfigure a storage drive",\n summary="{actor} wants to make a destructive storage change involving {target}.",\n impact="Files on the affected drive or partition can be permanently lost and the system may become unusable.",\n recommendation="Confirm the exact drive or partition and make sure required data is backed up.",\n target_strategy="system",\n confidence="derived",\n consequence_level="critical",\n safer_alternatives=(("preview", "List the exact drive or partition first."), ("backup", "Back up important data before changing storage.")),\n ),\n SemanticRule(\n rule_id="system.power",\n action_kind="system_change",\n executables=_SYSTEM_EXECUTABLES,\n headline="Change this computer's power state",\n summary="{actor} wants to shut down, restart, halt, or otherwise change {target}.",\n impact="Running work can be interrupted and unsaved changes may be lost.",\n recommendation="Confirm that stopping or restarting this computer is expected.",\n target_strategy="system",\n confidence="derived",\n consequence_level="high",\n safer_alternatives=(("review", "Save active work and confirm the host first."),),\n ),\n SemanticRule(\n rule_id="process.service",\n action_kind="process_stop",\n executables=_PROCESS_EXECUTABLES,\n headline="Stop or change a running process or service",\n summary="{actor} wants to control {target}.",\n impact="Applications, background services, or recurring jobs may stop working or become unavailable.",\n recommendation="Confirm the exact process, service, or job and use the narrowest action.",\n target_strategy="process",\n confidence="derived",\n consequence_level="high",\n safer_alternatives=(("preview", "Identify the exact running process or service first."), ("narrow", "Target only the intended process or service.")),\n ),\n SemanticRule(\n rule_id="git.remote_rewrite",\n action_kind="git_remote_change",\n executables=_GIT_EXECUTABLES,\n required_tokens=(frozenset({"push"}), frozenset({"--force", "-f", "--force-with-lease", "--delete"})),\n headline="Rewrite or delete shared Git history",\n summary="{actor} wants to change shared repository history involving {target}.",\n impact="Other collaborators can lose commits or need to repair their local branches.",\n recommendation="Review the remote and branch, preserve a backup ref, and prefer force-with-lease when rewriting is intentional.",\n target_strategy="git",\n confidence="exact",\n consequence_level="high",\n safer_alternatives=(("backup", "Create a backup branch or tag first."), ("narrow", "Prefer force-with-lease over an unconditional force push.")),\n ),\n SemanticRule(\n rule_id="git.remote_change",\n action_kind="git_remote_change",\n executables=_GIT_EXECUTABLES,\n required_tokens=(frozenset({"remote", "push", "fetch"}), frozenset({"set-url", "remove", "rename", "--delete"})),\n headline="Change a Git remote or shared reference",\n summary="{actor} wants to change {target}.",\n impact="Future pushes, fetches, or shared references can point somewhere different or disappear.",\n recommendation="Confirm the remote repository and reference before continuing.",\n target_strategy="git",\n confidence="derived",\n consequence_level="high",\n safer_alternatives=(("preview", "List remotes and references first."),),\n ),\n SemanticRule(\n rule_id="git.local_destructive",\n action_kind="git_history_rewrite",\n executables=_GIT_EXECUTABLES,\n required_tokens=(frozenset({"reset", "clean", "restore", "checkout", "rebase", "branch"}),),\n headline="Discard or rewrite local Git work",\n summary="{actor} wants to change local repository history involving {target}.",\n impact="Uncommitted files, staged work, local commits, or branches can be lost.",\n recommendation="Inspect the changes first and create a stash or backup branch when anything must be preserved.",\n target_strategy="git",\n confidence="derived",\n consequence_level="high",\n safer_alternatives=(("preview", "Review Git status and the affected commits first."), ("backup", "Stash changes or create a backup branch.")),\n ),\n SemanticRule(\n rule_id="package.script",\n action_kind="package_script",\n executables=_PACKAGE_SCRIPT_EXECUTABLES,\n required_tokens=(frozenset({"run", "run-script", "exec", "x", "dlx", "postinstall", "prepare", "prepublish", "build"}),),\n headline="Run a project or package script",\n summary="{actor} wants to run {target}.",\n impact="The script can change files, start processes, contact the network, or run code from installed dependencies.",\n recommendation="Inspect the script definition and run only the narrowest expected target.",\n target_strategy="package_script",\n confidence="derived",\n consequence_level="medium",\n safer_alternatives=(("preview", "Inspect the script definition before running it."), ("narrow", "Run only the specific expected script.")),\n ),\n SemanticRule(\n rule_id="container.privileged",\n action_kind="container_change",\n executables=_CONTAINER_EXECUTABLES,\n required_tokens=(frozenset({"run", "create"}), frozenset({"--privileged", "--pid=host", "--network=host", "--mount", "-v", "--volume"})),\n headline="Run a container with broad host access",\n summary="{actor} wants to run {target} with access that can reach parts of this computer.",\n impact="The container may be able to read secrets, modify host files, or expose services beyond the container boundary.",\n recommendation="Use a pinned image, read-only filesystem, and the narrowest mounts and capabilities possible.",\n target_strategy="container",\n confidence="derived",\n consequence_level="high",\n safer_alternatives=(("isolate", "Use a read-only filesystem and narrow mounts."), ("narrow", "Remove privileged or host-wide access when it is not required.")),\n ),\n SemanticRule(\n rule_id="container.destructive",\n action_kind="container_change",\n executables=_CONTAINER_EXECUTABLES,\n required_tokens=(frozenset({"rm", "prune", "system", "volume", "network"}),),\n headline="Delete or reconfigure container data",\n summary="{actor} wants to change {target}.",\n impact="Containers, images, volumes, networks, or cached data may be removed and may not be recoverable.",\n recommendation="Preview affected container resources before deleting them.",\n target_strategy="container",\n confidence="derived",\n consequence_level="high",\n safer_alternatives=(("preview", "List the affected containers, images, volumes, and networks first."),),\n ),\n SemanticRule(\n rule_id="container.change",\n action_kind="container_change",\n executables=_CONTAINER_EXECUTABLES,\n required_tokens=(frozenset({"run", "create", "exec", "start", "stop", "restart", "pull", "build"}),),\n headline="Run or change a container workload",\n summary="{actor} wants to change {target}.",\n impact="Containerized code can change files, processes, networks, and data available to the container.",\n recommendation="Confirm the image, command, mounts, and network access before continuing.",\n target_strategy="container",\n confidence="derived",\n consequence_level="medium",\n safer_alternatives=(("narrow", "Use a pinned image and the narrowest permissions."),),\n ),\n'''

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

5. Disk formatting labeled power change 🐞 Bug ≡ Correctness

The generated disk rule requires a destructive token in the arguments even though mkfs is normally
the executable, while the following power rule matches every _SYSTEM_EXECUTABLES member without
token constraints. Consequently mkfs /dev/sda1 misses system.disk_destructive and is presented
as changing the computer's power state.
Agent Prompt
## Issue description
The generated rules classify ordinary `mkfs` invocations as power-state changes because disk and power commands share one executable set and the disk matcher expects `mkfs` in argv.

## Issue Context
Use disjoint executable sets or executable-specific matching so formatting tools match the destructive disk rule without requiring their executable name as an argument.

## Fix Focus Areas
- .github/workflows/everyday-mode-implement-201-300.yml[36-41]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +38 to +41
const { resolved } = usePresentationMode();
const defaultState = defaultTechnicalDisclosure(resolved.value, required);
const [open, setOpen] = useState(defaultState.open);
const panelId = useId();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remediation recommended

10. Mode switch leaves details open 🐞 Bug ≡ Correctness

TechnicalDisclosure initializes open from the presentation mode only on mount and never responds
to later mode changes. If exact details are open in Technical mode, switching to Everyday mode
leaves the command visible instead of applying the Everyday disclosure default.
Agent Prompt
## Issue description
Disclosure state does not follow presentation-mode changes, so technical content can remain exposed in Everyday mode.

## Issue Context
Synchronize open state when `resolved.value` changes, while preserving required disclosures and any explicitly defined per-mode behavior.

## Fix Focus Areas
- dashboard/src/action-explanation.tsx[38-45]
- dashboard/src/action-explanation.tsx[59-60]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +115 to +120
const refresh = useCallback(async () => {
if (!loadFromCore) return;
try {
const payload = await fetchSettings();
setState({ status: "ready", resolved: resolvedFromSettings(payload.settings, sessionPreview) });
} catch (error) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remediation recommended

11. Stale settings responses win 🐞 Bug ☼ Reliability

Every preview change launches a new fetchSettings request, but responses update state
unconditionally using the preview captured when each request started. An older slow response can
arrive after a newer preview or successful mode update and overwrite the UI with stale resolved
settings.
Agent Prompt
## Issue description
Concurrent settings requests can apply stale mode and preview state out of order.

## Issue Context
Use cancellation or a monotonically increasing request identifier, and ensure refresh responses cannot overwrite a later mode mutation or preview selection.

## Fix Focus Areas
- dashboard/src/presentation-mode-provider.tsx[115-131]
- dashboard/src/presentation-mode-provider.tsx[133-147]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +131 to +134
def validate_builtin_explanation_coverage(
*,
rule_ids: Sequence[str],
catalog: CommandExtensionExplanationCatalog,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remediation recommended

12. Extension metadata is unused 🐞 Bug ⚙ Maintainability

The new extension explanation parser, coverage validator, and combined digest have no production
callers, so metadata cannot affect explanations and built-in registry coverage is never actually
validated. The documented extension metadata path is therefore dead code rather than delivered
functionality.
Agent Prompt
## Issue description
The explanation metadata module is only exercised by unit tests and is disconnected from the production extension catalog.

## Issue Context
Load verified metadata in the registry/catalog synchronization path, validate actual built-in rule IDs, and bind the resulting digest to explanation generation and consumers.

## Fix Focus Areas
- src/codex_plugin_scanner/guard/runtime/command_extension_explanations.py[105-156]
- src/codex_plugin_scanner/guard/runtime/command_extensions.py[236-244]
- src/codex_plugin_scanner/guard/runtime/extension_catalog_sync.py[240-243]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +16 to +19
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10
with:
ref: feat/everyday-mode-201-300
fetch-depth: 1

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remediation recommended

13. Export archives wrong commit 🐞 Bug ☼ Reliability

The export job checks out the mutable branch name and archives HEAD, but labels the artifact with
the push event's immutable github.sha. If the implementation workflow advances the branch before
checkout, the artifact name claims commit A while its source contains commit B.
Agent Prompt
## Issue description
The exported source can differ from the SHA encoded in its artifact name.

## Issue Context
Check out and archive `${{ github.sha }}` rather than the moving branch ref, or name the artifact from the actual checked-out commit.

## Fix Focus Areas
- .github/workflows/everyday-mode-source-export-201-300.yml[16-25]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +18 to +21
from .action_explanation_contract import (
ACTION_EXPLANATION_REDACTION_VERSION,
ACTION_EXPLANATION_RENDERER_VERSION,
GuardActionExplanationV1,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

14. Missing python explanation contract 🐞 Bug ≡ Correctness

Both new Python explanation runtime modules import .action_explanation_contract, but that module
does not exist in the repository. Importing the builder or semantic renderer therefore raises
ModuleNotFoundError, preventing the new runtime from loading and causing its tests to fail before
collection completes.
Agent Prompt
## Issue description
Add the missing Python action-explanation contract module, or redirect the imports to the existing authoritative equivalent. The builder and semantic renderer must be importable, able to validate their generated payloads, and no longer cause tests to fail before collection completes.

## Issue Context
Both newly added runtime modules unconditionally import the absent contract and use its parser while building explanations. Provide the versioned models, constants, parser, and action-kind definitions consumed by both modules, or change the imports to an existing equivalent contract.

## Fix Focus Areas
- src/codex_plugin_scanner/guard/runtime/action_explanation_builder.py[18-23]
- src/codex_plugin_scanner/guard/runtime/semantic_explanations.py[19-27]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@capy-ai capy-ai 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.

Capy found no issues.

View 1 other finding in Capy.

Open in Capy Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant