ECC/scripts
Gaurav Dubey 5987bd4dc6
feat(session-start): rank injected instincts by project/stack relevance (#2466)
* feat(session-start): rank injected instincts by project/stack relevance

Instinct selection at SessionStart ranked purely by confidence, so a
high-confidence instinct about an unrelated stack could take an injection
slot from a lower-confidence instinct that is actually relevant to the
current project.

Rank by confidence + location/stack relevance instead: project-scoped
instincts, and instincts whose domain/trigger matches the detected stack
(languages/frameworks via detectProjectType, plus terraform/dbt markers),
get a small additive boost. The confidence>=threshold floor and the
injection cap are unchanged, and ranking degrades to confidence-only when
nothing matches or when ECC_INSTINCT_RELEVANCE_RANKING is set to off.

The ranking helpers live in scripts/lib/instinct-relevance.js with unit
coverage in tests/lib/, plus an end-to-end ordering test in tests/hooks/.

Completes part (b) of #2371; part (a) (configurable count + threshold)
shipped in #2413.

Fixes #2371

* refactor(session-start): drop redundant confidence tiebreaker in instinct sort

Greptile flagged that the secondary `right.confidence` comparison in
summarizeActiveInstincts' sort was dead code when relevance ranking is
disabled and, when enabled, was reached only on a floating-point tie of the
combined score — where it skipped the intended scope-label tiebreaker.

Remove it: the primary combined-score comparison already reduces to
confidence-only ordering when relevance is off, so behavior there is
unchanged; a genuine combined-score tie now falls through to the documented
scope-first, then id, order.

* test: isolate instinct relevance environment

---------

Co-authored-by: haelyra <49814733+haelyra@users.noreply.github.com>
2026-08-10 21:46:24 -04:00
..
ci feat: add retention feedback loop and honest support matrix (#2681) 2026-08-04 21:42:25 -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 fix: complete Discord delivery receipts reliably (#2738) 2026-08-09 16:44:18 -04:00
hooks feat(session-start): rank injected instincts by project/stack relevance (#2466) 2026-08-10 21:46:24 -04:00
lib feat(session-start): rank injected instincts by project/stack relevance (#2466) 2026-08-10 21:46:24 -04:00
auto-update.js style: apply repo formatter to the security-fix files (no behavior change) 2026-06-18 20:03:24 -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(security): gateguard classifier bypasses (GHSA-4v57) + Windows CI + claw ReDoS 2026-06-18 20:02:30 -04:00
consult.js feat(install): add guided multi-harness installer (#2649) 2026-08-06 15:39:49 -04:00
control-pane.js feat: add dynamic workflow team orchestration surface 2026-06-04 21:45:13 +08:00
dashboard-web.js fix: harden local dashboard and data boundaries (#2585) 2026-07-27 11:11:29 -07:00
discussion-audit.js chore: gate canonical ECC release identity (#1991) 2026-05-19 06:42:17 -04:00
doctor.js feat: add retention feedback loop and honest support matrix (#2681) 2026-08-04 21:42:25 -04:00
ecc.js fix(ito-compute): complete device auth lifecycle (#2706) 2026-08-07 14:53:13 -04:00
feedback.js feat: add retention feedback loop and honest support matrix (#2681) 2026-08-04 21:42:25 -04:00
gan-harness.sh fix(skills): default GAN harness models to sonnet (#2442) (#2695) 2026-08-06 17:42:22 -04:00
gemini-adapt-agents.js fix: use scalar Claude agent tools (#2583) 2026-07-26 03:20:15 -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): add guided multi-harness installer (#2649) 2026-08-06 15:39:49 -04:00
install-guided.js feat(install): add guided multi-harness installer (#2649) 2026-08-06 15:39:49 -04:00
install-plan.js fix: restore short Claude plugin slug and skill installs (#1712) 2026-05-11 02:10:36 -04:00
ito.js fix(ito-compute): complete device auth lifecycle (#2706) 2026-08-07 14:53:13 -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
memory-mcp.mjs fix(mcp): accept reserved _meta field in tools/call params (#2670) 2026-08-04 00:28:09 -04:00
memory.js feat: add cross-harness memory vault (#2581) 2026-07-26 02:46:59 -07: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
plan-canvas.js fix(plan-canvas): deliver browser chat to the agent every time (#2739) 2026-08-09 18:15:25 -04: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
proximity-tick.js feat(layer4): live messages-table wiring for proximity triggers 2026-06-20 20:49:17 -04:00
release-approval-gate.js fix(release): derive approval gate paths from version (#2383) 2026-06-29 15:50:55 -07:00
release-video-suite.js fix(release): derive video suite paths from version (#2384) 2026-06-29 15:50:57 -07:00
release.sh feat(install): add guided multi-harness installer (#2649) 2026-08-06 15:39:49 -04:00
repair.js feat: add retention feedback loop and honest support matrix (#2681) 2026-08-04 21:42:25 -04: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
setup.js feat(install): add guided multi-harness installer (#2649) 2026-08-06 15:39:49 -04: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(codex): add ECC navigation guide (#2525) 2026-07-22 20:44:37 -04:00
uninstall.js feat: add retention feedback loop and honest support matrix (#2681) 2026-08-04 21:42:25 -04:00
welcome.js feat(install): add guided multi-harness installer (#2649) 2026-08-06 15:39:49 -04:00
work-items.js feat(control-pane): interactive JIT board — claim/move cards from the webapp 2026-06-18 18:16:46 -04:00
worktree-lifecycle.js feat: worktree-lifecycle service (deterministic conflict prediction + safe GC) (#2164) 2026-06-07 13:00:08 +08:00