Commit Graph
1012 Commits
Author SHA1 Message Date
haelyra 3b24eca2e6 feat(dsh): integrate version-scoped hook setup and distribution wiring 2026-10-10 17:49:37 -04:00
haelyra 603164ae79 feat(review): integrate consent-gated independent Codex review 2026-10-10 17:47:27 -04:00
haelyra a3e9ddfde7 feat(gateguard): integrate evidence-aware first-touch questions 2026-10-10 17:46:23 -04:00
haelyra 9d09febe5d fix(skills): scope host compatibility to target projections 2026-10-10 17:44:28 -04:00
haelyraandalizahidraja eb7ffd8d64 feat(agents): integrate isolated Pi conversion foundation from PR 3022
Carry the canonical IR, Pi emitter and source-schema doctor from https://github.com/affaan-m/ECC/pull/3022. Cursor and OpenCode emitters remain with the open source PR pending capability fixes.

Co-authored-by: alizahidraja <alizahidrajaa@gmail.com>
2026-10-10 17:43:18 -04:00
haelyra 58fc8f25a5 feat(qoder): integrate native plugin and SessionStart projection 2026-10-10 17:40:46 -04:00
haelyra 8757c69927 fix(hooks): integrate GNU sed execution receiver checks from PR 3493 2026-10-10 17:39:03 -04:00
haelyra 07c18210eb fix(qwen): adapt managed agents before ownership receipts 2026-10-10 17:38:07 -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
Matt Van Horn e128f4398b Merge branch 'main' into cursor/skill-host-compat-ci-10d0 2026-10-10 07:09:43 -07: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 aac9b3d34b fix: preserve activity errors, asset bytes and runner summaries
Treat non-2xx activity responses as feed errors, preserve non-Markdown Copilot agent assets, and apply the reviewed reference escape parity correction with regenerated bindings. Allow the test runner to drain piped output on its existing success or failure exit status. Validate installed workflows and bounded real Node20/24 pipe regressions.
2026-10-09 19:33:37 -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 5981dd7092 fix: complete reviewed integration workflows and safety checks 2026-10-09 18:54:39 -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 ba0520340f fix: reconcile reviewed sources and generated integration surfaces 2026-10-09 17:27:37 -04:00
haelyra b6e2cfe5e4 merge: preserve tested installer extraction 3187 and Copilot ownership fixture 2026-10-09 17:05:03 -04:00
haelyra d312d6f35c merge: preserve project and user Codex configuration source 3253 2026-10-09 17:02:47 -04:00
haelyra eed806bf4a fix: restore unskipped installer refactor validation
Follow up PR #3187 at 38b8c07f while preserving the original contribution history and all current-main helper bodies. Remove both CI safety-suite exclusions, clean stale imports and the warning glyph, retain shipped test/coverage entrypoints, and keep unknown test totals honest. The tree matches the fully tested 6246-pass/325-file tree; disposable Claude/OpenCode lifecycle passes.
2026-10-09 16:32:47 -04:00
haelyra 67c89375c3 merge: preserve serialized store source 3252 with portable cache fixtures 2026-10-09 16:28:34 -04:00
haelyra 195301cb04 merge: preserve tested optional dependency carry-forward 3119 2026-10-09 16:21:29 -04:00
haelyra cc288b6e28 merge: reconcile tested OpenCode home carry-forward with Copilot transforms 2026-10-09 16:20:04 -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 34ba911ad3 merge: preserve tested Python audit source 3007 2026-10-09 16:11:22 -04:00
haelyra 899a12310e merge: preserve tested dashboard read-once source 3002 2026-10-09 16:11:12 -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 2ad3bdbef4 merge: preserve tested Copilot install sources 2960 and 2963 2026-10-09 16:09:01 -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
haelyra 846c450658 fix: keep activity dashboard executable and bound log reads 2026-10-09 15:57:34 -04:00
haelyra 131c6186c3 feat: integrate native Copilot skill and agent distribution
Preserve contributor histories for PR #2960 and #2963. Resolve current-main conflicts without dropping OpenCode behavior. Reject traversal source paths, keep volatile inventory counts observational, and apply the shared ownership guard during every adapter repair while retaining adapter-derived roots. RED ownership and traversal regressions now pass, 73 lifecycle tests pass, and native Copilot observes 288 enabled project skills. Disposable install, missing-file repair, and uninstall preserve user-authored agents.
2026-10-09 15:53:38 -04:00
5e3863e512 perf: avoid duplicate skill file reads
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-10-09 15:50:20 -04:00
Danteandhaelyra c29a724bcd fix: declare optional cross-target install dependencies
Carry forward the final scoped delta of PR #3119 at 60e82f95. Keep required dependency closure and select only modules reachable from successful requests; refresh the unchanged 293-skill registry binding.
2026-10-09 15:43:31 -04:00
Yusuf Efeandhaelyra 0f34fdcc14 fix: resolve installed OpenCode skill paths consistently
Carry forward PR #3115 ef475c79 and 780dfb78 onto current main. Preserve the newer hook-consent transforms during install and repair. Main already includes the source import fix from #3167.
2026-10-09 15:40:12 -04:00
Yann Roberto 39796acf2f perf(state-store): reuse unchanged read snapshots
Keep the operation lock while validating bigint file identity and reuse
only snapshots produced by successful trusted static SELECTs. Avoid
reloading and exporting unchanged databases on repeated public reads.

Retain conservative comparison for generic SQL, including RETURNING and
PRAGMA writes, and invalidate reuse after transactions, exports or errors.
Cover cache invalidation, cross-process visibility, Windows device IDs,
reentrant partial writes, lock contention and independent result objects.

Validate 188 focused tests per environment on WSL Node 22.22.3 and native
Windows Node 22.15.0/24.16.0, plus 38 related WSL tests. Paired warm-read
benchmarks show 7.6-18.1x point-query speedup on 160 KiB/1.28 MiB databases.
2026-10-09 17:04:56 +08:00
Yann Roberto a6ce6fbbdb fix(state-store): tolerate missing Windows lock device IDs
Handle Windows Node path stats that report dev=0 for the same file whose
open descriptor reports a volume serial. Keep bigint inode checks strict,
retain device comparisons whenever both are known, and leave POSIX strict.

Cover zero-device identity cases, high inode precision, replacement and
file-type safeguards. Verify 164 focused tests each on native Windows
Node 22.15.0 and 24.16.0, plus WSL Ubuntu Node 22.22.3.
2026-10-09 16:46:19 +08:00
Yann Roberto f76c469fa7 fix(state-store): persist writes from prepared result queries
Compare the completed snapshot after get/all queries so RETURNING and
prepared PRAGMA writes survive reloads and reopening. Export only after
the outer operation or transaction succeeds; unchanged read snapshots
still avoid disk writes. This adds one export/byte comparison per read
snapshot without relying on SQL parsing or private sql.js APIs.

Add 18 regression cases covering multi-row INSERT/UPDATE/DELETE RETURNING,
standalone and transactional get/all, no-row PRAGMA writes, and rollback.
The unfixed adapter fails 16 of these cases. Strengthen read-only checks.

Validation: 148 focused tests pass on WSL Node 22 and Windows Node 24;
the general state-store suite passes 20/20 on WSL and 19/20 on Windows,
where the existing file-symlink fixture is denied by Windows permissions.
Scoped adapter coverage is 90.13% lines, 82.73% branches, 100% functions.
ESLint, Unicode safety, and git diff --check pass.
2026-10-09 16:28:30 +08:00
zakyirsyaad 93e6475420 fix(qwen): publish the adapter, handle CRLF, reject unknown flags
Three review findings, all verified before fixing.

1. Publish surface (blocking). package.json `files` lists
   scripts/gemini-adapt-agents.js but not this script, so the npm tarball
   omitted it and ecc-universal users hit MODULE_NOT_FOUND. Added to `files`
   and to the allowlist in tests/scripts/npm-publish-surface.test.js, which now
   passes 2/2.

2. CRLF agents were silently skipped. The frontmatter regex matched LF only, so
   a Windows-saved agent was reported as 'already compatible' while still
   carrying tools: Read, Bash and color: teal -- a success message with no
   adaptation. Normalize to LF, adapt, then restore the original ending style.
   Reproduced before and after: the same CRLF fixture went from 'Updated 0' with
   Read/teal intact to 'Updated 1' with read_file/cyan and CRLF preserved.

3. Unknown flags were discarded. Because the script rewrites files in place,
   `--dry-run` rewrote every installed agent and exited 0. parseArgs now throws
   on any unrecognized option before a directory is selected.

Tests: 12/12 (added CRLF preservation and no-mutation-on-unknown-flag),
gemini-adapt-agents 4/4 unaffected, npm-publish-surface 2/2. Re-run against all
68 canonical definitions: 68 updated, second run 0 updated, no Claude-shaped
frontmatter remaining, no spurious CRLF introduced.

Note: findings 2 and 3 apply equally to scripts/gemini-adapt-agents.js, which
has the same LF-only regex and the same flag filter. Left unchanged here to keep
this PR scoped to the Qwen adapter; worth a follow-up.
2026-10-09 13:46:34 +07:00
zakyirsyaad 7695b99348 fix(qwen): map WebSearch to web_search instead of dropping it
Review correction. The original version dropped WebSearch on the claim that Qwen
Code has no web search tool. That claim is wrong: Qwen Code exposes web_search as
a deferred tool, resolving through a DashScope search agent.

web_search is provider-dependent rather than universally present, but mapping is
still the better default than dropping. Where the provider supports it the agent
gains the capability; where it does not, Qwen Code ignores an unresolvable entry
in tools: without warning, so the outcome is the same as dropping. The reasoning
is recorded in a comment at the mapping so the choice is not silently reverted.

Across the 68 canonical definitions this changes two agents from losing a
declared capability to keeping it. Tests updated to assert the mapping; 10/10
pass and gemini-adapt-agents.test.js still passes 4/4.
2026-10-09 13:38:24 +07:00
zakyirsyaad 64eaa7d124 feat(qwen): add qwen-adapt-agents.js to normalize agent frontmatter
--target qwen installs all 68 agent definitions verbatim, so they carry Claude
Code tool names (Read, Write, Edit, Bash, Grep, Glob, WebSearch) and color: teal.
Qwen Code uses different tool ids, and its palette is red/blue/green/yellow/
purple/orange/pink/cyan/auto, so an unlisted value is dropped at load time with a
SUBAGENT_MANAGER warning.

ECC already solves this for Gemini via scripts/gemini-adapt-agents.js; this adds
the Qwen counterpart plus a test mirroring the Gemini one. The canonical agents/
directory is untouched -- each harness adapts its own installed copy.

Deliberate differences from the Gemini adapter, each a real Qwen behaviour:

  Edit              -> edit          (Gemini maps to replace)
  WebSearch         -> dropped       (Qwen has web_fetch only, no web search)
  mcp__server__tool -> unchanged     (Gemini lowercases to mcp_server_tool)
  color:            -> remapped      (Gemini removes it; teal becomes cyan)
  tools: output     -> comma scalar  (the form Qwen's own examples use)

model: is left alone, matching the Gemini adapter. 58 files say sonnet, 6 haiku,
4 opus and none are Qwen model ids, but Qwen logs no warning for them, so whether
they are ignored or resolved at dispatch time is unverified and changing 68 files
on an assumption seemed worse than flagging it as a follow-up.

Tested: 10/10 new cases pass and gemini-adapt-agents.test.js still passes 4/4.
Run against a copy of all 68 real definitions: 68 updated, 0 bodies changed,
0 invalid frontmatters, second run reports 0 updated. The result was installed
into ~/.qwen/agents and a headless Qwen session loaded all 68 with no errors and
no color warnings.
2026-10-09 12:55:36 +07:00
Varun GoreandGitHub 38b8c07f26 Merge branch 'affaan-m:main' into main 2026-10-08 19:36:33 +05:30