Commit Graph
396 Commits
Author SHA1 Message Date
haelyra 1abc625de9 fix: integrate six focused workflow repairs with canonical registry identity 2026-10-11 11:19:21 -04:00
haelyra c4b8325945 fix: prepare six focused ECC reliability repairs
Preserve complete source ancestry for PRs #3512, #3513, #3515, #3516, #3517 and #3518. Repair bounded recovery, alias compatibility and evaluator packaging gaps while keeping registry reuse inside the canonical loader. Verified actual hook, setup, dashboard, evaluator, sandbox and profile workflows plus full npm, Python, lint and supply-chain checks. ECC-043 preparation only; integration remains with the delivery owner.
2026-10-11 11:10:53 -04:00
haelyra a73e04cc6d fix: recover failed ledger batches and preserve project state 2026-10-11 09:42:05 -04:00
chenhz01 cffcf05e7a hooks: sed labels end at semicolon — commands after b/t/T/: are still scanned
CodeRabbit security finding on the merged sed work (CWE-693, verified live
on main via #3495): GNU sed labels for b, t, T and : end at ';' or newline —
verified against GNU sed 4.9 ('bar;e cmd' parses label 'a' and still runs
cmd; '}' is not a label terminator). Reading those operands to end of line
let 'sed :a;e git commit --no-verify' pass the hook while sed executed the
e command.

Labels are now read up to ';' or newline and command parsing resumes after
them. Text, filename and quit operands (a, c, i, r, w, q, Q) keep the
end-of-line reading: nothing after them on the line executes.

5 regression tests pin the three bypass paths and the benign boundary
(a bare label and a bare branch stay data). Suite: 817/817.
2026-10-11 18:52:44 +08:00
haelyra 3e395c6b76 fix: preserve opt-in usage data and publish networked callbacks 2026-10-11 03:53:30 -04:00
haelyra f58f15af30 Merge branch 'steward/install-20261011' of /Users/hira/Documents/ECC/ecc-review-install-20261011 into integration/ecc-043-20261011 2026-10-11 02:14:56 -04:00
haelyra 3add1816ea feat: offer an opt-in local Claude usage display
Scoped adaptation of PR #2716: keep compact rendering as the default and require ECC_STATUSLINE_USAGE=1. Installer registration, managed aliases and the Codex background bar remain outside this slice.
2026-10-11 02:09:06 -04:00
haelyra 43febb9ada fix: preserve opt-in GateGuard contract questions from PR 3497 2026-10-11 02:00:27 -04:00
montjeffrey f7f47679b6 fix(gateguard): make the external-contract question opt-in
- questionIdsFor and condensedHintFor take an optional
  { externalContract: true }; without it a code change that handles data
  asks data-schema only, and an unknown profile gets the original four
  questions and condensed hint.
- The hook reads GATEGUARD_EXTERNAL_CONTRACT_QUESTION with the same
  spellings as GATEGUARD_METRICS and passes it to the full denial, the
  condensed denial and the metrics record, so all three agree.
- The effectiveness harness's arm patch forwards the option, so an arm
  never drops it silently.

Docs: change-profile.md gains an External-contract question section and
qualifies "byte-identical to the fixed four questions"; design-notes.md,
SKILL.md (switch table, data rule, word-for-word set) and CHANGELOG say
the fifth question is opt-in; question-effectiveness.md and the harness
README note that the runner clears GATEGUARD_* variables, so a gate arm
from a current tree measures the gate without the question.
skill-triggers@1.json: registryDigest refreshed for the SKILL.md body
change; the description and triggers are unchanged.
2026-10-11 00:45:01 -04:00
montjeffrey 64d8971a64 fix(gateguard): credit only searches that could have seen the target
- Read file-type filters as include and exclusion globs: rg -t/--type
  and the Grep tool's type include ripgrep 14.1's globs for the type,
  rg -T/--type-not exclude them, fd -e/--extension includes *.<ext>.
  An unknown type name, --type-add or --type-clear is an unreadable
  filter and never credits, like --exclude-from.
- Treat a path pattern as a filter: the Glob tool's pattern must match
  the target below its root; a shell glob operand must match the target
  or a directory above it; a git pathspec matches the same way with its
  * also matching /. One operand that admits the target is enough.
- Extend "a search of the target itself gives nothing" to searches
  confined to the target's own file name: when every include, the Glob
  pattern, or every path pattern ends in that exact name, the stem never
  credits, and the closest-miss note says it was a lookup.
- Tokenize PowerShell searches with backslashes kept as path separators,
  as the read-only shell check already does; the old literal-prefix scope
  hid that src\core\*.ts reached the parser as srccore*.ts.
- Make an edit non-trivial when either text holds U+2028, U+2029 or
  U+0085, which end a JavaScript or C# line comment; the lexer splits
  lines only at \n and \r.

Extracting applyLongFilter, grepDetail and stemCredits leaves every
touched function at or below its complexity on main.
2026-10-10 23:38:47 -04:00
haelyra 0a181df218 fix(session): preserve optional startup context and independent history reads 2026-10-10 20:14:22 -04:00
haelyra e259e06c75 fix(plan-canvas): reconcile profile resolver and retain invalid feedback queues 2026-10-10 19:19:30 -04:00
haelyra 0b07708137 fix(plan-canvas): validate feedback IPC locator and request shape 2026-10-10 19:15:51 -04:00
haelyra 872df03e1f fix(hooks): enforce literal formatter invocation at spawn boundaries 2026-10-10 19:13:24 -04:00
haelyra 740fc4fa88 Merge refreshed PR #3491 request-model deduplication follow-up 2026-10-10 18:59:17 -04:00
Dante 6acaf769b9 fix(cost-tracker): retain model across duplicate usage blocks 2026-10-11 06:24:18 +08:00
haelyra be230bd85c feat: integrate reviewed adapters, conversion and GateGuard improvements 2026-10-10 17:53:23 -04:00
haelyra 38c40cda73 fix: integrate fourteen reviewed runtime and hook PRs 2026-10-10 17:50:39 -04:00
haelyra a3e9ddfde7 feat(gateguard): integrate evidence-aware first-touch questions 2026-10-10 17:46:23 -04:00
haelyra 810e5c0176 feat(context): integrate generation-bound advisory suggestions (#3453) 2026-10-10 17:44:29 -04:00
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 58fc8f25a5 feat(qoder): integrate native plugin and SessionStart projection 2026-10-10 17:40: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
chenhz01 3af000e143 hooks: first operand after -- is still the sed script when no script option was given
Greptile P1: sedScriptParts stopped at -- and discarded the remaining
operands, so 'sed -- <script>' skipped script collection entirely. GNU sed
4.9 (verified): with no -e/--expression anywhere, the first operand after --
is the script and an s///e in it still executes.

The operands after -- are now collected as positionals, so the existing
first-positional-becomes-script rule applies. Operands after the script stay
file names (data). 2 regression tests pin both sides. Suite: 812/812.
2026-10-11 03:55:27 +08:00
chenhz01 95964ee623 hooks: block escaped sed exec fragments conservatively; decompose sed readers
Greptile P1 findings (both verified by running GNU sed against the hook):

1. Escaped replacements evade the check: GNU sed decodes \xHH, \oOOO, \dNNN,
   case operations and unknown escapes like \g before executing an s///e
   replacement or e operand. Scanning the raw text let \x67it decode to git.
   Decoding that surface faithfully is out of scope, so any backslash in an
   exec-bearing fragment now throws UnsupportedSedEscape and the hook blocks
   with an explicit reason — mirroring the existing env -S escape precedent
   instead of pretending to interpret sed. Escaped-newline continuations of an
   e operand are refused by the same check.

2. Continued commands went unchecked: the e operand reader stopped at every
   newline, but GNU sed joins escaped newlines into one operand. Now covered
   by the same conservative refusal.

Also decomposes the sed readers into sub-50-line helpers per the repository
function-size rule (AGENTS.md): readSedDelimited, readSedCommand,
readSedExecute, readSedLineOperand, assertSedLiteral.

5 regression tests pin the escape paths and the benign boundary (a backslash
in a non-executing script stays data). Suite: 810/810.
2026-10-11 03:52:06 +08:00
chenhz01 34a7f41539 hooks: parse sed options through the whole argv — later -e scripts still execute
CodeRabbit security review (Major, CWE-693) correctly identified that GNU sed
collects -e/--expression scripts from any argv position: a script option after
positional operands is still executed, so stopping the option walk at the first
positional let an e-flagged script hide behind it.

Verified against GNU sed 4.9 before fixing:
- 'sed -e s/x/y/ - -e s/y/X/e' runs X (the later -e executes)
- with any script option present, every positional is a file operand

sedScriptParts now walks the full argv, collects scripts from all -e/
--expression positions, and only promotes the first positional to the script
when no script option was given. Unknown options after positionals still fall
back to the opaque default.

4 regression tests pin the reported bypass paths (suite: 805/805).
2026-10-11 03:38:02 +08:00
chenhz01 ffe0e36d46 hooks: model GNU sed execution — script and file operands are data, e/s///e are shell receivers
Ported from the #3051 discussion (test intent, not the old scanner):

- A confidently-parsed sed invocation whose script contains no execution
  construct is a pure text transformation: the script operand and every file
  operand are data. This removes the specific false positives where file names
  or non-executing scripts merely containing 'git ...' were blocked.
- The GNU sed `e` command (bare or with operand) and the `s` command with the
  `e` flag run text through the shell. Their literal fragments (the s
  replacement, the e operand) and any piped/redirected source are scanned as
  real shell source, closing the `printf x | sed 's/x/git commit --no-verify/e'`
  gap reported on 2026-10-09.
- Anything the literal parser cannot confidently read (addresses it cannot
  consume, -f script files, -i suffix ambiguity, unknown options, expansion
  residue) falls back to today's opaque default. No behavior changes for
  unmodeled launchers.
- shell-scan.js is untouched and remains the canonical scanner.

Tests: 14 focused cases ported from the #3051 litmus set; full hook suite
801/801.
2026-10-11 03:15:36 +08:00
Dante 53afd058be Merge remote-tracking branch 'origin/main' into fix/3488-generation-pricing 2026-10-11 01:04:12 +08:00
Dante 27c3ce1c10 fix(hooks): price Claude 5.5 per deduplicated request 2026-10-11 01:04:11 +08:00
Tivonsico 71bf78796f fix: keep session summaries within the lifecycle deadline 2026-10-11 00:15:12 +08:00
calm 2d9e6977dc feat: add native Qoder plugin support 2026-10-10 20:11:00 +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
montjeffrey 92947a68df Merge upstream/main into feat/gateguard-fewer-round-trips
Resolve six conflicts:
- hooks/hooks.metadata.json: keep this branch's gateguard description and
  fingerprint, add upstream's hookify-runtime entries.
- package.json: keep both gateguard-report.js and github-coordination.js.
- scripts/hooks/gateguard-fact-force.js, tests/hooks/gateguard-fact-force.test.js,
  skills/gateguard/SKILL.md: upstream added a simpler session denial cap; this
  branch already has the fuller one (cap threaded through
  markCheckedAndCountDenial, malformed-value warning, miss and target notes),
  so keep it. Upstream's taskset and su wrapper handling, fail-closed
  recursion limit and soft-hyphen sanitising merged cleanly and their tests pass.
- manifests/context-packs/skill-triggers@1.json: take upstream's file and
  recompute registryDigest for the merged registry.
2026-10-09 20:38:25 -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