Commit Graph
346 Commits
Author SHA1 Message Date
haelyra d05a507c8b Merge PR #3490: reserve lifecycle time for Stop persistence
Isolate deadline fixtures from inherited dry-run/disabled hook flags. Remove an unapproved emoji from the new routing regression to satisfy Unicode validation.
2026-10-10 17:43:46 -04:00
haelyra ecf2f31cb7 Merge PR #3476: select native Windows shell paths 2026-10-10 17:39:48 -04:00
haelyra 54a9278560 Merge PR #3464: identify hooks by their input sessions 2026-10-10 17:38:00 -04:00
haelyra 3b9fc44e14 Merge PR #3445: launch formatter shims safely on Windows 2026-10-10 17:37:18 -04:00
haelyra 27875bfd02 Merge PR #3444: track OpenCode skill runs and report measurement gaps 2026-10-10 17:37:11 -04:00
haelyra dd527e3613 Merge PR #3443: match nested TypeScript diagnostics on Windows 2026-10-10 17:36:28 -04:00
haelyra 7753a55d08 Merge PR #3416: route hook state through Claude profiles
Preserve the explicit shared ~/.claude project root already shipped on main. Canonicalize macOS temporary workflow fixture paths.
2026-10-10 17:35:45 -04:00
Tivonsico 71bf78796f fix: keep session summaries within the lifecycle deadline 2026-10-11 00:15:12 +08:00
34a97fa898 fix: reject unsupported env split-string escapes
Validate env -S and --split-string escape syntax before shell scanning or
opaque fallback. Preserve literal single-quoted data and charge each
validation character against the shared input-proportional work budget.

Verified 787 focused cases and 290 real Git/config, harmless native env
and registered-routing controls. Keeps the prior paid-copy protection.

Co-authored-by: Nguyen Thanh Dat <ntdat812.dev@gmail.com>
Co-authored-by: Davemaina1 <dmain7015@gmail.com>
2026-10-09 21:04:20 -04:00
993b5f230f fix: guard literal Git hook redirects and env split arguments
Carry forward bounded literal include/includeIf configuration capabilities
and env -S/--split-string words from PRs #2858 and #2897. Charge array
copy and expansion work before allocation to preserve the shared quota.

Verified 731 hook cases and 60 real Git/config and registered-route
controls. Dynamic remainder and original full source PRs remain held.

Co-authored-by: Nguyen Thanh Dat <ntdat812.dev@gmail.com>
Co-authored-by: Davemaina1 <dmain7015@gmail.com>
2026-10-09 20:41:09 -04:00
haelyra 984d4f0701 fix: preserve Hookify Windows missing-device identity
Match the Windows missing volume-serial exception while retaining strict reported-device, inode, ownership, permission, link and snapshot checks. Add loader warning/block and race regression controls with isolated platform metadata injection.
2026-10-09 19:10:06 -04:00
haelyra 0cb1476f9d fix: pin and bound Hookify rule reads
Open with supported no-follow and nonblocking flags before relying on file metadata. Validate descriptor, pathname and rule-directory consistency before and after reading at most64KiB plus one overflow byte. Reject observed replacement, mutation, premature EOF and non-regular files, and close descriptors on every outcome.

Add12 race and I/O regressions. Keep the Hermes uppercase protected-file fixture real on case-sensitive filesystems and verify that the installed guard still permits first-time creation.

Validation: full6688 reported tests across347 files,12 race tests, full80% coverage gates, scoped Hookify coverage, installed Hookify and Hermes workflows, packed artifact lifecycle, lint, signatures and IOC.
2026-10-09 17:54:01 -04:00
haelyra 7265b989c4 merge: preserve tested bounded Hookify carry-forward candidate 3055 2026-10-09 16:17:57 -04:00
haelyra 46ec7aca9b merge: preserve tested SQL wrapper guard source 3050 2026-10-09 16:16:43 -04:00
haelyra 83cd2ad91e merge: preserve tested commit-review source 2974 2026-10-09 16:10:04 -04:00
haelyra a6f6faed2a merge: preserve source 2983 with tested activity dashboard fixes 2026-10-09 16:09:59 -04:00
haelyra 3ab06e8c6c merge: preserve reviewed routing wrapper source 2755 2026-10-09 16:05:14 -04:00
haelyra c4f419bea0 merge: refresh reviewed stewardship source 3280 on current main 2026-10-09 16:02:58 -04:00
wellkiloandhaelyra a50ee13cac feat: execute bounded local Hookify rules in lifecycle hooks
Carry forward PR #3055 at 92f53c4c onto ef648e01, preserving contributor attribution and current main. Focused maintainer fixes reuse shared input ceilings, preserve late root context through outer bootstrap, bound frontmatter before immutable parsing, and assert real oversized input in the limits workflow.
2026-10-09 15:59:20 -04:00
montjeffrey c6b2c55b87 fix(hooks): never run .sh hooks through the WSL bash launcher on Windows
plugin-hook-bootstrap (shell mode) and observe-runner probed a bare
`bash.exe`. On Windows that resolves to the first match on PATH, and
%SystemRoot%\System32 normally sits ahead of Git's bin directory, so the
pick was System32\bash.exe: the WSL launcher. The existing guard (require
a clean probe exit) only catches it when no distro is installed. With one
installed, the probe passes inside Linux, then the hook script is handed
over by a Windows path (C:\...) or a Git Bash path (/c/...), neither of
which exists in WSL. The hook exits 127 instead of running, and
observe-runner's continuous-learning observation fails on every call.

Resolve bash candidates on Windows to absolute paths from PATH, skipping
bash.exe in System32, SysWOW64, Sysnative, and the WindowsApps alias
directory, so a native bash later on PATH (Git's) is used. With none
available, the existing "no bash binary found" skip applies. An explicit
BASH override still wins, and other platforms keep bare names.

The shared resolver lives in scripts/lib/windows-bash.js with a
platform-independent test. A Windows integration test puts System32 ahead
of Git's bash and requires the .sh hook to actually run. Upstream's
bootstrap fails that scenario with exit 127 ("/bin/bash: C:Users...hook.sh:
No such file or directory"); this one prints the hook output.
2026-10-09 15:56:14 -04:00
Eneko Ruiz 684c971173 fix(hooks): resolve session IDs from hook payloads 2026-10-08 23:46:56 +02:00
YogurDungeon b4943a5e4b fix: record skill runs under OpenCode and report unmeasured skills honestly
Under OpenCode the skill-health dashboard had no writer and no honest
fallback, so it reported every discovered skill as healthy (#2463).

Root cause: `post:skill:track` is only wired for Claude Code, where
`posttooluse-dispatcher.js` fans the event out to `skill-run-tracker.js`.
The OpenCode plugin re-implements the harness events instead of reusing that
dispatcher, so nothing ever wrote `skill-runs.jsonl` — and the tracker's
matcher only accepted the exact Claude Code tool name `Skill`, while OpenCode
calls the tool `skill`, so even wiring it would have dropped every event.
Commands that locate ECC through the inlined resolver in
`scripts/lib/resolve-ecc-root.js` also fell back to `~/.claude`, which does
not contain ECC, so they could not find their scripts.

Changes:

- `.opencode/plugins/ecc-hooks.ts`: dispatch `post:skill:track` from
  `tool.execute.after`. The tracker module is imported lazily and behind
  try/catch, matching the existing `changed-files-store` pattern: this file is
  OpenCode's startup entry point, so a static import failure would crash the
  session before any hook runs (#2530). The module is reused rather than
  reimplemented, keeping its identifier validation, length bounds and
  "never persist prompt text" guarantees.
- `scripts/hooks/skill-run-tracker.js`: match the tool name case-insensitively
  so `Skill` and `skill` are both accepted.
- `scripts/lib/skill-evolution/health.js`: split the summary into
  measured/healthy/declining/unmeasured instead of deriving `healthy = total -
  declining`, which turned "no telemetry" into "everything is fine" for every
  skill.
- `scripts/lib/skill-evolution/dashboard.js`: show the breakdown and warn
  explicitly when skills have no recorded runs, since absence of telemetry is
  not a health signal.

Under OpenCode the resolver also needs `CLAUDE_PLUGIN_ROOT`, which only the
plugin can supply: `shell.env` exports it when a root is found, without
replacing a root the user set or one an earlier plugin already put in
`output.env`.

Root discovery is per capability and probes required runtime files — never
optional content. Probing for `skills/continuous-learning-v2` (the
`workflow-quality` module) rejected supported modular installs that ship the
plugin and tracker without that optional module, disabling telemetry and the
root export for exactly those users.

Also fixes an incidental bug: the compiled plugin bundle is ESM, where
`__dirname` is undefined, so the ECC version lookup silently fell back to its
default. The module directory is now derived from `import.meta.url`.

Tests: `tests/opencode-plugin-hooks.test.js` covers the telemetry dispatch
(skill tool recorded, other tools ignored, minimal profile respected), a
modular install without the optional skills module, the root export and both
override paths; `tests/hooks/skill-run-tracker.test.js` covers the
case-insensitive matcher; `tests/lib/skill-evolution.test.js` and
`tests/lib/skill-dashboard.test.js` cover the unmeasured bucket, the warning
and the aged-out-coverage wording.

Refs #2463, #2530
2026-10-07 19:45:21 -05:00
Yann Roberto 1cf47ab0e5 fix(hooks): run Windows formatter shims in quality gate 2026-10-07 14:33:30 +08:00
agammann a3f00af6d2 fix(hooks): report nested TypeScript errors on Windows 2026-10-06 23:10:48 -07:00
L4XB f838085274 fix(gateguard): reach SQL clients behind shell flag clusters, su and taskset
main resolves SQL clients behind env -S and its launcher grammars, but a
destructive statement still passed under four forms:

- a shell -c inside a short-option cluster (bash -lc, sh -ec), since only
  an exact -c was looked up;
- su, whose -c / --command / -lc value runs through the target user's
  shell, before or after --;
- taskset, whose mask or CPU list precedes the command, like timeout's
  duration;
- a command nested past the shell -c recursion limit, which was allowed
  instead of denied.

The first three are checked like sh -c; past the limit the check now
fails closed.
2026-10-05 15:56:53 +02:00
basil-k-aji-dev cd85014b9e fix(plan-canvas): route session state through CLAUDE_CONFIG_DIR
The Plan Canvas library wrote ~/.claude/plan-canvas while the SessionStart
and Stop hooks read CLAUDE_CONFIG_DIR/plan-canvas. Under a second profile
SessionStart missed open reviews and Stop let a turn end with feedback
still queued.

Expand a leading ~ in CLAUDE_CONFIG_DIR the way scripts/lib/agent-data-home.js
does, so a profile written as ~/.claude-work resolves to one directory rather
than two.

Add hook-level coverage that spawns each hook with a distinct
CLAUDE_CONFIG_DIR and no ECC_* override, plus a producer-to-consumer round
trip. Eight of the nine cases fail against the previous revision.
2026-10-03 20:20:40 +05:30
Suliman Abdulrazzaq 238309ce29 Merge branch 'main' into fix/gateguard-session-budget 2026-10-03 10:29:38 +03:00
basil-k-aji-dev 00d73fbae2 fix(hooks): honor CLAUDE_CONFIG_DIR instead of writing to ~/.claude
Claude Code points every profile-local path at CLAUDE_CONFIG_DIR when it is
set, but ECC hooks kept reading and writing ~/.claude. A session launched
under a second profile left its bash log, cost tracker, metrics, session data
and skill runs in the default profile, where the other one reads them back.

Two groups, as reported:

- getDefaultClaudeAgentDataHome() in scripts/lib/agent-data-home.js now
  follows the variable, which covers every hook reaching ~/.claude through
  resolveAgentDataHome(). ECC_AGENT_DATA_HOME still wins, so the documented
  workaround keeps working.
- plan-canvas-pending, plan-canvas-sessions, mcp-health-check and
  post-bash-command-log hard-coded os.homedir()/.claude and now resolve the
  same way, matching scripts/hooks/ecc-statusline.js:68.

A blank value is ignored rather than resolved, since path.resolve('  ')
returns the process cwd and would scatter profile data through whatever
directory the session started in.

Fixes #3266
2026-10-03 12:34:14 +05:30
Affaan MustafaandGitHub c05b2d6614 chore: retire the Everything Claude Code name, ECC only (#3330)
* chore: retire the Everything Claude Code name, ECC only

Replace the expanded product name and the everything-claude-code slug
with ECC across READMEs, translated docs, harness folders, skills,
commands, scripts and examples. Repo URLs now point at affaan-m/ECC.

Rename repo-internal artifacts to ecc forms (ecc-conventions skill,
ecc-guardrails, ecc-research-playbook, ecc-team-config, ecc-instincts
with ecc-* ids) and update .claude/ecc-tools.json.

Legacy install ids, plugin dirs, package names and MCP prefixes stay
where existing installs resolve against them. The codex global-state
check and harness-audit repo detection accept the new name first and
the legacy one as a fallback. The Discord bot prefers ~/GitHub/ECC and
falls back to the nested legacy checkout path.

Refresh the skill-triggers registryDigest for the changed skill text.

* fix(ecc-tools): drop managed paths to the removed Claude repo skill

.claude/skills/<repo-skill>/SKILL.md was deleted in #2770 but stayed listed in
ecc-tools.json and the team config. Remove those entries and point the Claude
Code adapter at the existing .agents/skills/ecc-conventions/SKILL.md.
2026-10-01 17:50:41 -05:00
haelyra 3c17f41a43 docs: resolve integration review findings 2026-09-30 18:58:26 -04:00
haelyra cc9d2c3b65 Merge remote-tracking branch 'refs/remotes/pr/3255' into maint/stewardship-batch-2026-09-30 2026-09-30 13:21:01 -04:00
haelyraandGitHub 83b66cac25 Merge branch 'main' into fix/gateguard-session-budget 2026-09-29 14:58:53 -04:00
haimingZZ 23939c637e fix(gateguard): strip SOFT HYPHEN (U+00AD) from sanitizePath 2026-09-29 01:17:25 +08:00
affaan-m 93fca4a604 Merge reviewed Biome-filename correction from PR2835
Source-PR: https://github.com/affaan-m/ECC/pull/2835
Source-Head: 7ffea7091a
2026-09-28 07:07:45 -04:00
affaan-m e10bbaa492 Merge reviewed append-assignment correction from PR2965
Source-PR: https://github.com/affaan-m/ECC/pull/2965
Source-Head: eca846248d
2026-09-28 07:07:45 -04:00
affaan-m 7ffea7091a fix(hooks): distinguish Biome configs from results files
Preserve the original contributor histories and apply the exact independently reviewed repair.

Source-Parent: 74023e5689
Review-Manifest-SHA256: 208a6350119857df7c1e5b83a46cdba0b7f7399f58ed60167397920c7a21b454
2026-09-28 07:07:07 -04:00
affaan-m eca846248d fix(hooks): track append assignments in Git override checks
Preserve the original contributor histories and apply the exact independently reviewed repair.

Source-Parent: dee884656e
Review-Manifest-SHA256: 0c7eeef7c2722a605d049daf2dc3c2473c10dd616005afcba21049fc036d8ce9
2026-09-28 07:05:14 -04:00
affaan-m 807f07a687 Merge reviewed Git environment scope correction for PR2965
Source-PR: https://github.com/affaan-m/ECC/pull/2965
Source-Head: dee884656e
2026-09-28 05:39:46 -04:00
affaan-m dee884656e fix(hooks): preserve Git configuration across shell command scopes
Preserve contributor history while applying the exact reviewed current-main repair.

Source-PR: https://github.com/affaan-m/ECC/pull/2965
Source-Parent: ec0753bc7f
Review-Manifest-SHA256: 0172e3e695e672305f9bc41b0d385d2a299d8ec520c763dd9d7f6da743f76971
2026-09-28 05:38:05 -04:00
affaan-m da2edcb740 Merge reviewed PR2835 qualified configuration protections
Preserve exact-file protections, all shared assertions and private cleanup.

Source-PR: https://github.com/affaan-m/ECC/pull/2835
2026-09-28 05:01:22 -04:00
affaan-m 78dee5c829 Merge reviewed PR2845 configuration filename protections
Source-PR: https://github.com/affaan-m/ECC/pull/2845
2026-09-28 04:58:30 -04:00
affaan-m 74023e5689 fix(config-protection): protect qualified shared linter configurations
Preserve contributor history while applying the exact reviewed current-main repair.

Source-PR: https://github.com/affaan-m/ECC/pull/2835
Source-Parent: e58bb26647
Integration-Main: d3b8a3e908
Review-Manifest-SHA256: 2b591ee5fc545e0d552a58dd6f473f196ca773a194c33b87359f5c0447187e26
2026-09-28 04:50:09 -04:00
affaan-m 339db5b0be fix(config-protection): guard current config and ignore filenames
Preserve contributor history while applying the exact reviewed current-main repair.

Source-PR: https://github.com/affaan-m/ECC/pull/2845
Source-Parent: e19e74a7fc
Integration-Main: d3b8a3e908
Review-Manifest-SHA256: 02ef909e8553e93554ec8fb615b9299fd3ee6a0d7dc250ee2375ce80ce538060
2026-09-28 04:49:31 -04:00
affaan-m 442179e7d6 Merge exact reviewed PR2829 follow-up
Source-PR: https://github.com/affaan-m/ECC/pull/2829
Source-Head: 2b9164c042
Review-Manifest-SHA256: 16b9e4c854b6cfc38efc99d0913fe7f3018a68b9b1c194b50f4a1e06511975cd
2026-09-28 04:07:07 -04:00
affaan-m f4528c48a7 Merge exact reviewed PR2965 follow-up
Source-PR: https://github.com/affaan-m/ECC/pull/2965
Source-Head: ec0753bc7f
Review-Manifest-SHA256: 53ead3eb859a4c6c13d6751b1fe4f9a94f1a5d35a37430f6b8524c50e903490b
2026-09-28 04:07:07 -04:00
affaan-m 2b9164c042 fix(gateguard): inspect SQL clients behind supported launchers
Preserve contributor history while applying the exact reviewed current-main repair.

Source-PR: https://github.com/affaan-m/ECC/pull/2829
Source-Parent: c4b18b452d
Review-Manifest-SHA256: 16b9e4c854b6cfc38efc99d0913fe7f3018a68b9b1c194b50f4a1e06511975cd
2026-09-28 03:56:57 -04:00
affaan-m ec0753bc7f fix(hooks): preserve shell boundaries and detect literal hook bypasses
Preserve contributor history while applying the exact reviewed current-main repair.

Source-PR: https://github.com/affaan-m/ECC/pull/2965
Source-Parent: de480c65fd
Review-Manifest-SHA256: 53ead3eb859a4c6c13d6751b1fe4f9a94f1a5d35a37430f6b8524c50e903490b
2026-09-28 03:56:48 -04:00
affaan-m 609427cacc Merge commit 'de480c65fdbbdf8b0b6ffce0f16c0968791c5fbd' into affaan/integrate-reviewed-followups-20260928 2026-09-28 02:27:57 -04:00
affaan-m de480c65fd fix(hooks): distinguish literal data from executable shell contexts
Preserve original contributor history and all current-main assertions while bounding quote, heredoc, shell-option and deferred-scan handling.

Source-PR: https://github.com/affaan-m/ECC/pull/2965
Source-Parent: 5a878131de
Main-Parent: d3b8a3e908
Review-Manifest-SHA256: 5d23f47e60516b66733805aec0ebcd47f19265c964529fa0b1220c8aa6903add
2026-09-28 02:27:11 -04:00
affaan-m c4b18b452d fix(gateguard): classify standard launcher and GNU time options
Preserve contributor history and current-main behavior while resolving the exact reviewed follow-up.

Source-PR: https://github.com/affaan-m/ECC/pull/2829
Source-Parent: d811349224
Review-Manifest-SHA256: a7209685b2a5726777f7450a5983c28add8759654969b09ba3e4b803fcfaf8bd
2026-09-28 01:06:31 -04:00