ECC/scripts
kapil971390 3cdc69a0ea
fix(gateguard): check isDestructiveFindExec on each command segment to close compound-command bypass (#2292)
* fix(gateguard): check isDestructiveFindExec on each command segment

`isDestructiveBash` called `isDestructiveFindExec` only on the raw full
command string. When the raw string starts with a non-find command (e.g.
`echo x && find . -exec rm {} \;`), `isDestructiveFindExec` checks
tokens[0] and returns false — then the per-segment loop never calls it
again, letting the destructive `find -exec rm` segment through silently.

Fix: call `isDestructiveFindExec(segment)` inside the per-segment loop so
compound commands (`&&`, `;`, `|`) cannot be used to prepend a harmless
command and bypass the find-exec destructive check.

Adds three regression tests covering `&&`, `;`, and `|` bypass patterns.

* fix(gateguard): use raw body segments for isDestructiveFindExec to close quoted-binary gap

The previous per-segment call passed quote-stripped output from
splitCommandSegments to isDestructiveFindExec, so a quoted exec binary
like find . -exec 'rm' {} \; would arrive as find . -exec  {} \; and
the check would silently miss it.

Switch to splitting collectExecutableBodies output on [;|&]+ without
quote-stripping first, so the find-exec binary name is always intact
when isDestructiveFindExec inspects it. This also covers || and
background & separators that the original tests did not exercise.

Adds a regression test for the || OR-chain bypass pattern.

Addresses Greptile review comments on PR #2292.

---------

Co-authored-by: kapilvus <kapilvus@gmail.com>
2026-06-18 16:30:46 -04:00
..
ci Merge pull request #2241 from itkdm/feat/add-vue-ecosystem 2026-06-15 14:07:31 -04:00
codemaps feat: add scripts/codemaps/generate.ts codemap generator Fixes #247 - The generate.ts script referenced in agents/doc-updater.md was missing from the repository. This adds the actual implementation. The script: - Recursively walks the src directory (skipping node_modules, dist, etc.) - Classifies files into 5 areas: frontend, backend, database, integrations, workers - Generates docs/CODEMAPS/INDEX.md + one .md per area - Uses the codemap format defined in doc-updater.md - Supports optional srcDir argument: npx tsx scripts/codemaps/generate.ts [srcDir] 2026-02-22 16:19:16 +05:30
codex fix: add plugin cache health check (#2249) 2026-06-15 14:01:25 -04:00
codex-git-hooks fix: skip pre-push checks on branch deletion 2026-03-29 23:09:26 +09:00
discord release: 2.0.0 — the agent harness operating system 2026-06-09 21:40:40 -04:00
hooks fix(gateguard): check isDestructiveFindExec on each command segment to close compound-command bypass (#2292) 2026-06-18 16:30:46 -04:00
lib docs+chore: add README Security section; fix lint regressions on main 2026-06-16 02:08:14 -04:00
auto-update.js feat: add auto-update command 2026-04-29 21:01:27 -04:00
build-opencode.js fix: restore ci baseline for opencode packaging 2026-04-05 14:47:26 -07:00
catalog.js feat: add install catalog and project config autodetection 2026-03-27 05:56:39 -04:00
claw.js fix: send claude prompt via stdin so Windows shell mode does not mangle it (#2174) 2026-06-07 13:25:48 +08:00
consult.js fix: tune machine learning workflow routing 2026-05-11 18:11:05 -04:00
control-pane.js feat: add dynamic workflow team orchestration surface 2026-06-04 21:45:13 +08:00
dashboard-web.js chore: reconcile publish/agent surfaces after PR batch 2026-06-15 14:21:28 -04:00
discussion-audit.js chore: gate canonical ECC release identity (#1991) 2026-05-19 06:42:17 -04:00
doctor.js fix(scripts): add os.homedir() fallback for Windows compatibility 2026-03-28 11:28:12 +08:00
ecc.js feat: add dry-run mode for hook execution (#2116) (#2188) 2026-06-15 14:01:21 -04:00
gan-harness.sh fix: harden install planning and sync tracked catalogs 2026-03-31 22:57:48 -07:00
gemini-adapt-agents.js feat: add gemini agent adapter 2026-04-08 15:38:49 -07:00
github-coordination.js refactor: apply code-review findings to github-native coordination 2026-06-11 14:05:42 -04:00
harness-adapter-compliance.js docs: add data-backed harness adapter scorecard (#1785) 2026-05-12 02:59:52 -04:00
harness-audit.js fix: guard two script edge cases (tolerant package.json parse, set -u empty array) (#2088) 2026-06-07 13:01:21 +08:00
install-apply.js feat(install-targets): add claude-project (per-project Claude Code) adapter 2026-05-19 12:14:27 -04:00
install-plan.js fix: restore short Claude plugin slug and skill installs (#1712) 2026-05-11 02:10:36 -04:00
list-installed.js fix(scripts): add os.homedir() fallback for Windows compatibility 2026-03-28 11:28:12 +08:00
loop-status.js fix: handle dotted reserved snapshot names 2026-04-30 12:25:14 -04:00
mcp-inventory.js feat: MCP inventory (ecc.mcp.v1) — unified cross-harness MCP config view (#2146) 2026-06-06 03:55:17 +08:00
observability-readiness.js security: add supply-chain IOC scanner (#1904) 2026-05-14 21:15:35 -04:00
operator-readiness-dashboard.js docs: sync live native payments gate evidence 2026-05-19 23:25:38 -04:00
orchestrate-codex-worker.sh fix: resolve all CI test failures (19 fixes across 6 files) (#519) 2026-03-16 01:59:53 -07:00
orchestrate-worktrees.js fix: preserve orchestration launcher compatibility 2026-03-12 15:40:25 -07:00
orchestration-status.js feat: orchestration harness, selective install, observer improvements 2026-03-14 12:55:25 -07:00
platform-audit.js docs: sync selected-target announcement gate (#2020) 2026-05-19 22:09:45 -04:00
preview-pack-smoke.js docs: sync selected-target announcement gate (#2020) 2026-05-19 22:09:45 -04:00
release-approval-gate.js Add release approval gate 2026-05-19 18:18:54 -04:00
release-video-suite.js chore: add release video visual qa 2026-05-19 09:16:35 -04:00
release.sh fix: context-size /compact trigger, Codex marketplace plugin path, live README badges (#2237) 2026-06-11 16:21:53 -04:00
repair.js fix(scripts): add os.homedir() fallback for Windows compatibility 2026-03-28 11:28:12 +08:00
session-inspect.js feat: self-improving skills loop — observe, inspect, amend, evaluate 2026-03-14 23:21:18 -07:00
sessions-cli.js fix(scripts): add os.homedir() fallback for Windows compatibility 2026-03-28 11:28:12 +08:00
setup-package-manager.js fix: reject flags passed as package manager names in setup-package-manager CLI 2026-02-13 03:37:46 -08:00
skill-create-output.js fix: narrow unicode cleanup scope 2026-03-29 21:21:18 -04:00
skills-health.js feat(design): skill health dashboard mockup (#518) 2026-03-16 14:01:41 -07:00
status.js feat: add github-native coordination (epic-* commands + scripts + tests) 2026-06-11 12:58:11 -04:00
sync-ecc-to-codex.sh feat: sync the codex baseline and agent roles 2026-04-01 16:08:03 -07:00
uninstall.js fix(scripts): add os.homedir() fallback for Windows compatibility 2026-03-28 11:28:12 +08:00
work-items.js feat: sync GitHub queue into work items 2026-05-11 13:07:29 -04:00
worktree-lifecycle.js feat: worktree-lifecycle service (deterministic conflict prediction + safe GC) (#2164) 2026-06-07 13:00:08 +08:00