{"id":50814207,"url":"https://github.com/alexshchuka/neuro-matrix","last_synced_at":"2026-06-13T08:02:18.163Z","repository":{"id":361545481,"uuid":"1249601026","full_name":"AlexShchuka/neuro-matrix","owner":"AlexShchuka","description":"AI + developer co-system protocol grounded in common sense, scientific method, and Nash-equilibrium cooperation.","archived":false,"fork":false,"pushed_at":"2026-06-10T09:02:57.000Z","size":223,"stargazers_count":3,"open_issues_count":9,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-10T09:13:22.367Z","etag":null,"topics":["claude-code","claude-skills","harness","harness-engineering"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlexShchuka.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-25T21:51:50.000Z","updated_at":"2026-06-10T07:30:48.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/AlexShchuka/neuro-matrix","commit_stats":null,"previous_names":["alexshchuka/neuro-matrix"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AlexShchuka/neuro-matrix","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexShchuka%2Fneuro-matrix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexShchuka%2Fneuro-matrix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexShchuka%2Fneuro-matrix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexShchuka%2Fneuro-matrix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlexShchuka","download_url":"https://codeload.github.com/AlexShchuka/neuro-matrix/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexShchuka%2Fneuro-matrix/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34276504,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-13T02:00:06.617Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["claude-code","claude-skills","harness","harness-engineering"],"created_at":"2026-06-13T08:02:16.836Z","updated_at":"2026-06-13T08:02:18.155Z","avatar_url":"https://github.com/AlexShchuka.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# neuro-matrix\n\nA Claude Code plugin that calibrates an AI + developer co-system on common sense, scientific method, and Nash-equilibrium cooperation. Agents, hooks, an invariant-driven self-check, and a held-out evaluation harness.\n\n**What it is:** an anti-hallucination («anti-neuroslop») **harness for Claude Code** — runtime **invariants** with a per-turn self-check, deterministic **hooks**, four **agents** (developer · analyzer · critic · epistemic-auditor), a dual approval+verification gate, and a held-out **evaluation harness** that keep AI-assisted coding anchored to reality. *Topics: Claude Code plugin, AI agents, prompt engineering, LLM evaluation, AI code review, hooks, agentic, AI safety.*\n\n## Install\n\n```text\n/plugin marketplace add AlexShchuka/neuro-matrix\n/plugin install neuro-matrix@neuro-matrix\n```\n\nRequires [Claude Code](https://code.claude.com). On install: a risk-weighted invariant self-check each turn, cycle / critic / verification hooks on mutations, four sub-agents for analysis, code, review, and epistemic audit.\n\nThe operating protocol lives in `CLAUDE.md`. This README answers: **why, on what concepts, how to work as a team, and what the project is for.**\n\nThe name is a nod to John Forbes Nash Jr. — payoff matrices in game theory, the mind matrices Nash drew on glass in *A Beautiful Mind*, and the neurodivergent cognitive style that powers systems thinking under uncertainty.\n\n## 1. Goals\n\n**Defensive**: keep AI-scaled development from degrading the codebase and engineering culture.\n\nWhat the industry shows:\n- Duplicated code blocks growing multi-fold (GitClear «AI Copilot Code Quality Research 2025», 153M LOC; vendor report, not peer-reviewed).\n- AI-generated code carries ~1.7× more issues and +75% logic bugs (CodeRabbit «State of AI vs Human Code Generation», Dec 2025, 470 PRs; vendor report, not peer-reviewed).\n- AI-generated code share: Google 75% (Pichai, Apr 2026); Microsoft ~30% (Nadella, Apr 2025); industry 15–25% committed lines (Larridin Developer Productivity Hub, 2026).\n\nThis protocol does not accept that outcome. **Neuroslop** — code that looks plausible but is architecturally meaningless — accumulates unless the system catches it.\n\n**Outputs**: (a) codebase health, (b) culture of systems-thinking, (c) currency with AI practice. All three are non-contradictory.\n\n**Knowledge transfer goal**: tacit «how to work with AI» knowledge from systems-thinkers (including neurodivergent developers) is formalized into the protocol. The cognitive style: **hyper-systemizing** (Baron-Cohen 2009), **monotropism** (Murray/Lesser/Lawson 2005), **detail-focused processing** (Frith \u0026 Happé 2006). The connection to architectural defense is the hypothesis this plugin tests; the eval harness probes it.\n\n## 2. Meta-concepts\n\nCalibration of priors, not imperative rules — the protocol shapes how the AI weighs alternatives.\n\n**Systems theory** — agents, hooks, eval, and developer are connected by feedback loops; drop any layer and equilibrium breaks.\n\n**Game theory** — anchor-verification dominates hallucination; per-mutation gating dominates unauthorised mutation; mutual doubt dominates unilateral fallibility; own-interest cooperation dominates sycophancy.\n\n**Base operational concepts:**\n- **Co-system** — AI + developer + a shared artifact. Both err. The system catches errors mutually.\n- **AI = hypothesis generator; developer decides and bears responsibility.**\n- **Symmetric fallibility (mutual doubt)** — both sides err; epistemic-auditor operationalizes the developer-side detection.\n- **Cooperation strategy** — the agent pursues protocol concepts in its own interest; does not capitulate to sycophancy; does not «just do the task» when the task violates the protocol.\n- **Common sense + scientific method** — the only admissible roots of any rule.\n- **Epistemic boundary** — confirmed (paired with tool output this reply) vs. associative (marked `associated from X, not verified`).\n- **Halt on no-progress / contradiction** — third identical attempt stops; contradiction in own words — stop and resolve.\n- **Mental-model gate** — act only with 2–3 variants validated against counter-variants.\n- **Mutation gate** — every state-changing action requires explicit recent consent.\n- **Cultural transmission** — the protocol is operational for the AI and cognitive scaffolding for the developer simultaneously.\n\n**Cross-cutting ideas**: halt on contradiction; fix the binding constraint (compress, not expand); teaching by demonstration — every refusal carries a one-line «why».\n\n**Invariants** in `invariants.txt` — three groups: agent-side, developer-side (mutual doubt), cooperation-strategy. Each carries risk-class `[critical|important|style]`, deontic-class `[O|P|F]`, and a `Counter:` clause. One invariant is sampled **risk-weighted** each turn via `UserPromptSubmit` hook (`scripts/random-invariant.sh`).\n\n**Operational gates:**\n- `scripts/random-invariant.sh` — samples one invariant per turn.\n- `scripts/cycle-detector.sh` — blocks `Bash`/`Edit`/`Write`/`MultiEdit`/`NotebookEdit` on three identical calls in a row.\n- `scripts/auto-critic.sh` — **approval gate**: blocks `git push` and MR-creation tools until `@critic` returns approve.\n- `scripts/verification-gate.sh` — **verification gate**: on `git commit`, runs machine-checkable evidence (`bash -n` for shell, `ast.parse` for Python, `jq empty` for JSON) and blocks if any fails. Dual gate per `arXiv:2511.05524` — approval-only ≈ 100% false-completion, verification-only ≈ 25%, dual gate → 0%.\n- `scripts/self-review-preflight.sh` — on critical-review prompts, emits a reading-list reminder to prevent inverted sycophancy.\n\n## 3. How to work with the AI as a team\n\nTen rules. The protocol does the rest.\n\n1. **AI is a hypothesis generator, not an oracle.** Any claim about code requires tool-evidence in the same reply.\n2. **Do not give vague prompts.** Concrete anchors (`filename:line`, exact strings, ticket IDs) → fewer hallucinations.\n3. **Ask for variants, not «the single right answer».** The AI surfaces 2–3 variants; you converge through your own reasoning.\n4. **Before push / MR — call `@critic`.** The auto-critic hook enforces this on `git push` and MR-creation tools.\n5. **When in doubt about facts — call `@epistemic-auditor`.** It marks associative vs confirmed; anything tagged `associated from X, not verified` requires manual verification.\n6. **If the AI loops, the system stops itself on the 3rd identical attempt** (cycle-detector hook). Reframe the task.\n7. **Every turn the AI runs a random self-check** against one invariant from `invariants.txt`.\n8. **Decisions and responsibility live with the developer.** Any merged artifact is yours, as if hand-written.\n9. **The agent does not capitulate.** If your request violates the protocol — expect a refusal + counter-proposal. That is the cooperation strategy, not stubbornness.\n10. **Critical-review is a special case.** On «critically evaluate» / «review» / «assess» prompts, delegate to `@critic` or apply critic-invariants locally. Otherwise **inverted sycophancy** fires — plausible critique without reading the artifact.\n\n## 4. Project intent\n\nThis plugin exists so that AI-assisted development *does well and does no harm* — scientifically, through systems-thinking and strategic vision. It is **not a security gate against the agent itself** — it is a co-system calibration tool; the developer remains the decision-maker and responsible party.\n\nIt formalizes tacit knowledge of senior systems-thinkers into a protocol, defends the codebase from neuroslop, and develops toward a measurable cumulative effect through two-sided error detection, epistemic discipline, and pre-registered statistical proof that each change improves the whole.\n\n## Agents\n\nAgents are bound to **roles** in the co-system. Names are current bindings; the protocol depends on the role, not the name.\n\n| Binding | Role | Responsibility |\n|---|---|---|\n| `analyzer` | system investigator | RCA, architecture, MR/PR review, dead-end diagnostics |\n| `developer` | code mutator | Code, tests, build, git push — the only mutator |\n| `critic` | anti-neuroslop reviewer | Reviews proposed output before it lands in shared state |\n| `epistemic-auditor` | epistemic auditor | Boundary between confirmed and associative + developer-side mutual-doubt checks |\n\nStack specifics can be placed in `references/per-stack/\u003cstack\u003e.md`.\n\nThe eval harness — paired Wilcoxon + bootstrap CI on Cohen's d + McNemar one-sided under a pre-registered decision rule — lives in `eval/run_suite.py` and `eval/statistical_test.py`. Binary rubric (18 criteria, MET/UNMET) removes central-tendency bias; `--k N` runs with median aggregation; Krippendorff α on 18 binary criteria raises inter-rater reliability; a canary GUID in every probe + `scripts/check-canary-leak.py` catch contamination. Methodology: 2026 SOTA for rubric-based LLM evaluation.\n\n## Copyright\n\n© 2026 Aleksandr Shchuka. Licensed under the MIT License — see `LICENSE` and `COPYRIGHT-NOTICE.md`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexshchuka%2Fneuro-matrix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexshchuka%2Fneuro-matrix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexshchuka%2Fneuro-matrix/lists"}