Commit Graph
3943 Commits
Author SHA1 Message Date
wzc f6eeb46986 test(install): add regression tests for npm prerequisites and extract constant 2026-09-09 16:49:44 +08:00
wzc 0352b0ef7b chore: ensure pure ASCII in install.ps1 header comment 2026-09-09 16:43:27 +08:00
wzc 5c78d38bab fix(install): fail closed on unparseable Node version and make test env immutable
- Reject unparseable or empty Node.js version output before major version check
- Define minimumNodeMajor constant to eliminate duplicate version numbers
- Build child test environments immutably without in-place mutation
- Add regression test for unparseable Node.js version output
2026-09-09 16:34:27 +08:00
wzc 018c311bcf fix(install): preflight Node.js and npm prerequisites in install.ps1
- Check for Node.js presence and major version (>= 18) before invoking installer
- Check for npm presence when node_modules is missing during git-clone installs
- Use [Console]::Error.WriteLine to ensure clean stderr output and preserve exit codes
- Add regression tests in tests/scripts/install-ps1.test.js covering missing and outdated Node.js environments
2026-09-09 16:24:00 +08:00
iyashjayesh 51fe0e9163 Move token-card to a skill, pin the CLI, and fix three doc contradictions
Addresses the review on #3039. Four findings, all of them real.

Skills-first (Greptile P2). AGENTS.md says commands/ exists for compatibility and
the direction is skills-first, so the workflow now lives in skills/token-card
and commands/token-card.md is a thin shim pointing at it — 70 lines down to 28.

Unpinned remote code (CodeRabbit major, Greptile P1, CWE-494). The workflow ran
`npx -y @tokenchit/cli@latest` and handed whatever the registry currently serves
read access to local session logs. It is pinned to 0.7.0, the skill says to raise
the pin knowingly, gives the `npm view … dist.integrity` check, and step 1 is now
an explicit confirmation before the first download on a machine.

The "no network request" claim was false as written (both bots). `sync` sends
nothing, but the npx invocation around it is a registry download, and the
sentence read as though the whole step were offline. It now separates the two.

`--dry-run` wrote a file (Greptile P2). Step 1 created `.tokenchit.json` via
`init` before `sync --dry-run` ran, so a documented no-op mutated the tree.
Initialisation is skipped on a dry run and reported as prospective instead.

The README offer was unreachable (Greptile P2). "Stop after step 3" sat directly
below step 4, so the step that puts the card in the README — the whole point —
could never run. The boundary moved to after step 4; publishing still requires
being asked for by name.

Wiring: agent.yaml skills list, manifests/install-modules.json under
operator-workflows (beside cost-tracking and ecc-tools-cost-audit), and
package.json `files`, which the npm-publish-surface test requires to track the
module graph. `yarn install --mode=update-lockfile` leaves yarn.lock byte
identical, so nothing to commit there. docs/tr/AGENTS.md carries two skill counts
the catalog sync does not reach, both 286 -> 287.

npm test: 4396 passed, 0 failed. markdownlint clean on both files.
2026-09-09 12:58:07 +05:30
iyashjayesh 1052523127 feat(commands): add token-card command 2026-09-09 11:50:14 +05:30
Seekers2001 a28d60c7bc Merge remote-tracking branch 'origin/main' into sync-pr-2943 2026-09-08 17:35:23 +08:00
ravitejarenangi df77893e0a feat(install): hermes-hooks install module — installer-native delivery
Greptile's review asked for committed coverage and installer parity; this
makes the hooks installable through ECC's own machinery instead of a
copy-paste doc:

- manifests/install-modules.json: new module hermes-hooks (kind hooks,
  targets hermes + openclaw, paths hooks/hermes + docs/HERMES-HOOKS.md,
  light/stable, defaultInstall). Disjoint from hooks-runtime, which stays
  Claude/Cursor/OpenCode/CodeBuddy — the Hermes target gets hooks support
  without inheriting the Claude-format hook graph.
- manifests/install-profiles.json: full profile gains hermes-hooks (validator
  requires full to include every module).
- docs/HERMES-HOOKS.md: install section now leads with
  ./install.sh --target hermes --modules hermes-hooks --enable-hooks; the
  manual block registers from the landed ~/.hermes/hooks/hermes/ paths. The
  installer never edits config.yaml — registration stays operator-owned.
- tests/hermes-hooks.test.js: installer-integration case (14 total) drives
  the real installer into a throwaway HOME and proves the LANDED guard
  blocks an eslint.config edit.

Validated: install-manifests (37 modules), no-personal-paths, markdownlint,
14/14 tests. E2E on a throwaway HOME: module lands both scripts + doc and
the landed guard emits a block decision.
2026-09-08 13:03:06 +05:30
ravitejarenangi b30a8c782a fix(hooks): address review — close bypasses, surface failures, add test suite
Greptile + CodeRabbit review of #3019:

- config-protection: compare basenames case-insensitively (macOS/Windows
  resolve ESLINT.CONFIG.JS to the protected eslint.config.js) and use lstat
  so a dangling symlink to a protected name still blocks (os.path.exists
  follows the link and returns False).
- Both hooks: fail-open stays, silence goes — every swallowed path now
  writes a one-line stderr diagnostic.
- config-protection: sys.stdout.write instead of print() per repo Python
  style; block decisions carry a trailing newline.
- New tests/hermes-hooks.test.js: 13 cases through the real scripts via
  spawnSync — block (all names, case variants, dangling symlink, edits[],
  per-tool), allow (normal source, new config, non-edit tools), fail-open
  with diagnostics (malformed payload, missing path, unreadable file).
- docs: absolute-path copy-paste block via $HOME (CodeRabbit: /Users/YOU
  placeholders were unverifiable), self-contained block-case proof that
  creates its target, pointer to the committed suite.
2026-09-08 12:38:29 +05:30
ravitejarenangi 879a17092c feat(hooks): add Hermes-native config-protection and console-log guards
Hermes ships its own shell-hook system (hooks: block in config.yaml,
Claude-compatible JSON payloads, per-tool matchers, consent allowlist),
and the hermes install target deliberately ships no hook runtime — so
Hermes operators get rules/skills/commands with zero hooks. This ports
the two harness-independent ECC hooks as self-contained Python scripts
with no ECC runtime dependency:

- config-protection: blocks edits to existing lint/format configs and
  ratchet baselines (pre_tool_call)
- check-console-log: warns on console.log() in edited TS/JS (post_tool_call)

Includes install, consent, and verification steps in docs/HERMES-HOOKS.md.
2026-09-08 12:26:52 +05:30
Affaan Mustafa 5064474d4d fix: integrate verified ECC 2.2.1 maintenance patches (#3012)
All 48 hosted checks passed on 165074ecf4.

Fixes #2921
Fixes #2924
Fixes #2909
Fixes #2952
Fixes #2964
Fixes #2957
Fixes #2982
v2.2.1
2026-09-07 18:36:32 -04:00
haelyra 165074ecf4 test: fix Windows ownership paths and failure annotations 2026-09-07 18:09:46 -04:00
haelyra 14e731c6d5 fix: close release review gaps and expose failing CI suites 2026-09-07 17:57:26 -04:00
cnYui e39eeb7447 fix(docs): correct broken asset paths in Turkish guides
The Turkish translations of the longform, security, and shortform guides
linked images with `../assets/...`, which resolves to a non-existent
`docs/assets/` directory, so every embedded image rendered as broken.

Assets live at the repository root (`assets/`), so from `docs/tr/` the
correct relative prefix is `../../assets/`. This matches the canonical
root guides (`./assets/`) and the Spanish (`docs/es/`) and Simplified
Chinese (`docs/zh-CN/`) translations, which already use `../../assets/`.

Fixes 26 image/asset links across the three guides.
2026-09-08 06:13:56 +09:00
haelyra ba3a64a2c5 fix(setup): preserve preflight guarantees across ownership filtering 2026-09-07 16:53:53 -04:00
haelyra adb39a13c9 test: make release safety fixtures CodeQL-clean
Use literal matching for the forbidden documentation endpoint, pin lifecycle mode/content assertions to one descriptor, and inject parent races through the staged descriptor without forwarding arbitrary file-creation flags.
2026-09-07 16:51:51 -04:00
haelyra d542cbe4cd Merge Windows-safe Claude settings race regression fixtures 2026-09-07 16:51:51 -04:00
haelyra a220947fb5 test(install): exercise settings races safely on Windows
Close fixture-owned descriptors when Windows blocks a directory rename before open returns. Assert OS rejection preserves both settings files and releases staging handles. Move the rename-boundary injection after descriptor close so Windows exercises parent-identity validation without skipping race coverage.
2026-09-07 16:49:20 -04:00
haelyra 8cc31f1e5f docs(release): record reviewed 2.2.1 bug fixes and verification boundaries 2026-09-07 16:41:45 -04:00
c11753d0b9 fix(skills): replace invented autonomous harness setup instructions
Resolve #2957 using the verified MCP reference memory package, native session scheduling, supported CLI invocation and documented computer-use integration. Incorporates the corrective direction from #2977 and #2958, including package-version pinning and regression checks for executable examples.

Co-authored-by: ilkmajans-cpu <ilkmajans-cpu@users.noreply.github.com>

Co-authored-by: kavish-19 <63698788+kavish-19@users.noreply.github.com>
2026-09-07 16:41:45 -04:00
59b74901c4 fix(install): preserve user files and honor uninstall previews
Generalize PR #2981 ownership protection to every managed target. Reject mismatched target state and preserve files that appear during writes or failed-install checkpoints. Keep prior hashes for managed files a failed attempt never writes.

Integrate PR #2980 preview wording and global dry-run propagation, with PR #2956 fail-closed environment validation and CLI/legacy regression coverage.

Fixes #2964. Fixes #2952.

Co-authored-by: ilkmajans-cpu <ilkmajans-cpu@users.noreply.github.com>

Co-authored-by: wellkilo <wellkilo@foxmail.com>
2026-09-07 16:40:47 -04:00
haelyra 967a5fa4ba Merge reviewed Claude hook registration and settings containment fixes 2026-09-07 16:38:41 -04:00
haelyra 17b70f56fc Merge reviewed PowerShell enforcement fixes for 2.2.1
# Conflicts:
#	tests/hooks/gateguard-fact-force.test.js
2026-09-07 16:38:41 -04:00
haelyra 743cc6983c Merge verified observer failure retention into 2.2.1 patch 2026-09-07 16:34:57 -04:00
haelyra cf065358fb Merge pull request #2971 from wellkilo/fix/observer-analysis-completion-sentinel
fix(continuous-learning-v2): require analysis completion sentinel
2026-09-07 16:34:29 -04:00
haelyra dbe8bfbba9 fix(install): pin Claude settings parent during atomic replacement
Reject directory replacement after temporary file creation or staging, preserve unrelated files during cleanup, and retry settings edits observed before the final rename. Add three regression tests for the review findings.
2026-09-07 16:31:33 -04:00
haelyra 82bfd22578 docs(release): record reviewed patch candidates and limits 2026-09-07 16:29:28 -04:00
haelyra c85c39e01a fix(release): patch Yarn toml advisory and track 2.2.1 gates 2026-09-07 16:27:59 -04:00
haelyra e0252df02f fix: scope GateGuard exemptions to the project
Address #2921 and complete the segment-anchoring direction in #2979. Preserve explicit absolute exemptions while denying accidental matches in unrelated projects.
2026-09-07 16:27:01 -04:00
wakqasahmed fe3d82e280 fix(install): derive dependency versions from package.json, harden fixture isolation (#2822)
Addresses Greptile's review on #2994:

- missing-dependency.js no longer hardcodes a second copy of the four
  runtime dependency versions; it reads them from package.json's
  dependencies field instead, so the two can't silently drift apart.
  describeMissingDependencyError() still recognizes a tracked
  dependency even if package.json can't be read for some reason,
  just without a version-pinned install command in that case.
- The regression test now asserts no ancestor directory of its
  temp fixture has a node_modules, so a stray one wouldn't let
  Node resolve ajv/sql.js from there and mask what the test is
  actually meant to exercise. Also copies package.json into the
  fixture, matching a real plugin-marketplace git clone and what
  the version-lookup above now needs.
2026-09-07 16:26:10 -04:00
wakqasahmed ce11e8f690 fix(install): ship ajv/sql.js with the plugin install bundle (#2822)
install-plan.js and install-apply.js both require ./lib/install/config at
load time, and that module required ajv unconditionally at the top of the
file even though ajv is only actually used when validating an
ecc-install.json. When ECC is installed via the Claude Code plugin
marketplace, the marketplace directory is a bare git clone with no
node_modules, so requiring ajv crashes commands like --list-profiles that
never touch install-config validation at all.

Same root cause in scripts/lib/control-pane/state.js: sql.js and
@iarna/toml were required at module scope even though they are only used
inside openSqlDatabase() and readTomlConfig(), so control-pane.js --help
crashed too.

Make both requires lazy so they only load when the feature that actually
needs them runs. For the case where ajv/sql.js/js-yaml/@iarna-toml is
genuinely needed and still missing, add a small helper that turns the raw
MODULE_NOT_FOUND into an actionable message naming the package and the
install command, instead of a stack trace (install-apply.js) or, worse, an
unhandled crash with a usage banner tacked on that reads like a bad
argument (install-plan.js, control-pane.js). Applied the same helper to
memory-mcp.mjs, where ajv is genuinely load-bearing (it compiles every MCP
tool's JSON schema up front) so it can't be made lazy the same way.

Added a regression test that copies just scripts/, schemas/, and
manifests/ into a directory with no node_modules anywhere above it in the
filesystem, which reproduces the plugin-marketplace install exactly, and
asserts install-plan.js and control-pane.js still work.
2026-09-07 16:26:10 -04:00
haelyraandDavidHLP f2bcc00d69 fix(pi): prevent recursive compiled OMP hook execution
Forward-port #2911 for #2909 and exercise the real adapter lifecycle with a recorded process boundary, including unavailable Node and invalid overrides.

Co-authored-by: DavidHLP <lysf15520112973@163.com>
2026-09-07 16:26:10 -04:00
haelyraandjackie-cqz 20b1ba423e fix(hooks): preserve complete bounded passthrough payloads
Forward-port #2925 for #2924 and verify ASCII and multibyte over-limit input suppression. Supersedes the overlapping direct-entrypoint fix in #2978.

Co-authored-by: jackie-cqz <2557911191@qq.com>
2026-09-07 16:26:10 -04:00
haelyra bf0ac4e4b3 fix: reject late PowerShell scalar resolution 2026-09-07 16:23:30 -04:00
Seekers2001 51a0ba9ec6 fix(governance): handle documented parser forms 2026-09-07 17:37:44 +08:00
Nguyen Thanh Dat c88b3f879a test(gateguard): cover dd with an intervening option before if=
Named in review on #2829: `dd bs=1M if=/dev/zero of=/dev/sda` is the same
class as the reversed-operand case and is denied by the token-based check,
but nothing pinned it.
2026-09-07 15:48:02 +07:00
Nguyen Thanh Dat 249b0ecf7f test(gateguard): fail the allow-cases when the hook returns nothing
The "does not gate as destructive" cases guarded the decision behind
`if (output && output.hookSpecificOutput)`, so a crashed or silent hook made
parseOutput return null and the test passed having asserted nothing.

Assert the exit code and that output parsed first, then branch: a decision
object must not be a Destructive deny, and pass-through must echo the input
back — the same shape the existing retry case already checks.

Raised in review on #2829.
2026-09-07 15:48:02 +07:00
Nguyen Thanh Dat 79d3fefad1 fix(gateguard): detect dd by command word, not by text match
Review on #2829 found the regex fix widened a false positive: matching
`\bdd\s+if=` against the whole flattened line gated `echo dd if=/dev/zero`
and `grep dd if=/dev/zero file`, neither of which runs dd. That class was
already present before — `echo dd if=x` matched the old arm too — but the
boundary fix extended it to the slash and dot spellings, so the arm now
decides on text position rather than on what is being executed.

dd moves to isDestructiveDd(tokens), next to isDestructiveRm and
isDestructiveGit, and DESTRUCTIVE_SQL_DD goes back to SQL only. The
per-segment loop already tokenizes every executable body, so the check runs
where the command word is known.

This resolves four things the text match could not:

  dd if=/dev/zero of=/dev/sda    was allowed  -> denied  (the reported bug)
  sudo dd if=/dev/zero           was allowed  -> denied
  dd of=/dev/sda if=/dev/zero    was allowed  -> denied  (operands are order-free)
  echo dd if=x                   was denied   -> allowed (pre-existing false positive)

Leading sudo/doas/env, their flags, and VAR=value assignment prefixes are
skipped so a wrapped invocation still resolves to dd; flags are only skipped
once a wrapper has been seen, so the scan cannot walk into an unrelated
command's arguments.

Tests: 6 fail on upstream main, 155 pass with this change.

Refs #2642
2026-09-07 15:48:02 +07:00
Nguyen Thanh Dat 76786616f8 fix(gateguard): deny dd whose input path is not word-initial
DESTRUCTIVE_SQL_DD shared one trailing \b across every alternation arm.
`dd\s+if=` ends in `=`, and a \b after a non-word character only holds when
the NEXT character is a word character, so the arm matched `dd if=x` and
missed every path starting with `/`, `.` or a quote:

  dd if=/dev/zero of=/dev/sda    allowed
  dd if=./disk.img of=/dev/sdb   allowed
  dd if="/dev/zero" of=/dev/sda  allowed

The word-boundary suffix now applies only to the arms that end in a word
character. The split is what keeps the widening bounded: dropping the
trailing \b outright would let `truncate` match `truncated`, and dropping the
leading \b would let `dd if=` match inside `add if=`. Both are covered.

This is the half of #2642 that survived the structural findGitSubcommand()
parser, which already handles `git checkout -- .`.

Not addressed here: `dd of=/dev/sda if=/dev/zero` with the operands reversed
is still allowed, before and after, because the pattern requires `if=`
immediately after `dd`. That is a different defect from the boundary bug and
widening a P0 gate's pattern shape is a maintainer call.

Refs #2642
2026-09-07 15:47:37 +07:00
wellkilo c9dd92037d fix(audit): mirror pytest discovery rules 2026-09-07 16:04:42 +08:00
wellkilo 720796ed48 fix(audit): align pytest discovery semantics 2026-09-07 15:45:40 +08:00
Samarjeet Singh Tomar f8c0c2c182 fix(install): gate OpenCode hook activation
Signed-off-by: Samarjeet  Singh Tomar <samar_tomar@hotmail.com>
2026-09-07 02:26:37 -05:00
wellkilo d216de9207 fix(audit): recognize Python consumer test suites 2026-09-07 14:16:41 +08:00
wellkilo 2de2a592dc fix(cursor): validate blocking hook input 2026-09-07 09:41:16 +08:00
Darwin PardaveandCopilot App 80aca43106 perf: avoid duplicate skill file reads
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-06 20:35:50 -05:00
wellkilo 0718ec240f fix(cursor): fail closed on oversized guard input 2026-09-07 09:27:54 +08:00
wellkilo cb24b0acd7 fix(cursor): consolidate hook event dispatch 2026-09-07 09:02:06 +08:00
wellkilo f59cfd57c2 fix(install): harden Claude settings lifecycle 2026-09-07 01:57:04 +08:00
wellkilo 26d3e0038b fix(install): surface Claude settings failures 2026-09-07 01:13:20 +08:00
wellkilo 569e5a36bb feat(install): register manual Claude hooks 2026-09-07 00:53:13 +08:00