Skip to content

Develop - #55

Merged
MethodWhite merged 37 commits into
mainfrom
develop
Aug 12, 2026
Merged

MethodWhite merged 37 commits into
mainfrom
develop

Conversation

@MethodWhite

Copy link
Copy Markdown
Owner

Description

Type of change

  • Bug fix (non-breaking)
  • New feature (non-breaking)
  • Breaking change
  • Database / schema
  • MCP tool
  • Refactor (no functional changes)
  • Documentation

Checklist

  • cargo build --release succeeds
  • cargo test passes
  • cargo clippy has no new warnings
  • cargo fmt has been run
  • No eprintln! noise under SYNAPSIS_QUIET=1
  • Errors use JSON-RPC error field, not result.content
  • New tools have inputSchema with types, defaults, descriptions
  • Changes are backward-compatible (or marked as breaking)
  • Database migrations have version bump in schema_version

Database changes

  • Schema migration required (version: ___)
  • FTS index needs rebuild
  • No database changes

Related issues

Closes #...

MethodWhite and others added 30 commits July 11, 2026 12:41
…re and arca

- Add event: endpoint\ndata: /message to GET /sse handler so MCP SDK clients
  (Claude Desktop, Cursor, Gemini CLI, OpenCode) can discover the POST endpoint
  immediately on SSE connection

- Add [patch] overrides in Cargo.toml so local development uses sibling repos
  directly without changing the public git dependencies:
    [patch."https://github.com/MethodWhite/synapsis-core"] -> ../synapsis-core
    [patch."https://github.com/MethodWhite/Arca"] -> ../arca

- Update CI workflow to checkout synapsis-core and arca as sibling directories
  so the [patch] overrides resolve correctly on GitHub Actions runners

All 16 cross_platform_tests pass with --test-threads=1
PR #54 targets develop but CI only ran on PRs to main, so test/fmt/clippy
never executed for the MCP SSE fix branch.

Co-authored-by: Cursor <cursoragent@cursor.com>
actions/checkout cannot write outside the workspace (../synapsis-core),
so use git clone to place deps where Cargo [patch] paths expect them.

Co-authored-by: Cursor <cursoragent@cursor.com>
Use GITHUB_TOKEN for git clone (Arca is private), shell bash for
cross-platform paths, and clone siblings in all cargo-dependent jobs.

Co-authored-by: Cursor <cursoragent@cursor.com>
Rewrite [patch] paths to deps/* at runtime so actions/checkout can
clone synapsis-core and private Arca within the GITHUB_WORKSPACE.

Co-authored-by: Cursor <cursoragent@cursor.com>
…cal-deps

fix: MCP SSE endpoint event + local [patch] overrides for synapsis-core and arca
- Arca repo is private; GITHUB_TOKEN lacks cross-repo access
  Remove Arca [patch] in CI; only patch synapsis-core (public)
- Revert OSV-Scanner to v1.9.2 (v2 startup failure persists)
- Fix clippy: collapsible_if in ollama.rs + auto-fixes in server/autoconfig
- SecDevOps: security gates, branch strategy, PR lifecycle
- SMART goals: Specific, Measurable, Achievable, Relevant, Time-bound
- MoSCoW+RICE priority system (P0-P3)
- Scalability targets and architecture
- Release flow and ecosystem layout
- Split Windows into separate `test-windows` job (continue-on-error, cargo check only)
  so it no longer blocks PR merge (~30min faster CI verdict)
- Remove codeql job (75min, low value for Rust)
- Extract repeated sibling checkout boilerplate into .github/actions/setup-synapsis
  composite action (DRY: 7 jobs → 1 definition)
- Remove `cargo clean` from geiger job (was destroying Rust cache)
- Remove release-drafter.yml (redundant with release-please)
- Pin synapsis-core git dep to tag v0.6.0
- Update AGENTS.md security gates table
- Zero-trust framework: DilithiumVerifier (ML-DSA-87) + real challenge-response auth
- PQC code extracted to external prusia-vault dependency (git)
- synapsis-core re-exports PQC from prusia-vault
- .cargo/config.toml + scripts/dev-setup.sh for automatic local patching
- CI: split Windows test, removed codeql, composite setup action
- src/core/auth/*.rs now re-exports from ztf crate
- Added ztf as git dependency with pqc feature
- Updated .cargo/config.toml with ztf patch
- All auth tests moved to ztf crate (21 tests)
- Add session_classifications map for per-session auth state
- classify_session() runs classifier on session start
- tool_permission() maps tool names to required Permission
- check_tool_permission() gates every tool call
- Permission denied returns MCP error code -32001
- Bumped synapsis-core dep from v0.8.0 to v0.9.0
- Added rag-core to dev-setup.sh siblings
- New graph_tools module with graph_search, entity_expand, graph_context
- Wired into call_tool dispatch + tool_permission mapping
- Tool descriptions in list_tools
- Queries entities/relations tables via rusqlite
- New tool: agentic_search with query planning and multi-iteration
- rag-agentic dependency + dev-setup update
- New audit-chain crate (v0.1.0) with AuditChain, verify_chain, optional PQC signing
- Migration v7 adds prev_hash, data_hash, chain_hash columns to audit_log
- log_audit() now computes chain hashes automatically
- New MCP tool: audit_verify to check chain integrity
- Database's verify_audit_chain() returns OK or error list
- deny.toml: license + copyleft + multiple-version bans
- CI: SBOM generation job (CycloneDX + SPDX)
- scripts/sbom.sh: local SBOM generation (deps, licenses, tree)
- Supply chain gates in CI: cargo-audit, cargo-deny, gitleaks, SBOM
- deny.toml synced to all ecosystem crates
…mas nuevos y matriz

- Sec 15: pipelines CI/CD de altos estandares (pinning, permisos minimos, gates, SLSA, firma).
- Sec 16: criptografia en reposo (AEAD + Argon2id, ChaCha20-Poly1305, PQC).
- Sec 17: sistemas nuevos y faltantes (Arca Quant/SaaS: broker, exchanges, billing, push, WS, backups).
- Sec 18: observabilidad.
- Sec 19: matriz actualizada por proyecto.
- prusia-vault v0.3.0: sustituye pqcrypto (PQClean archivado, RUSTSEC-2026-0161/62/63/66)
  por ml-kem (ML-KEM-1024) y ml-dsa (ML-DSA-87) de RustCrypto. API pública intacta.
- synapsis-core: pin rag-core/rag-graph por rev (wildcards de cargo-deny).
- rag-agentic: pin rag-core por rev.
- deny.toml: allow BUSL-1.1 y CDLA-Permissive-2.0; skip de duplicados conocidos
  del ecosistema RustCrypto/windows; sin claves deprecadas (severity-threshold).
- Cargo.toml: git deps pinneados por rev + version (Tier S++ supply chain).
- CI: unificar bloques env duplicados, git config insteadOf para repos privados.
- Fix imports en tui.rs y tests cross-platform (clippy/fmt).
Extiende el estándar normativo del ecosistema con 4 secciones:
- §20 Gobernanza: roles (Security Owner/maintainer/revisor/autor), proceso
  de aprobación, regla de cambios compartidos, responsabilidad de seguridad,
  métricas.
- §21 Diseño y UX segura: secure UX, usabilidad (ISO 9241/25010), accesibilidad
  (WCAG 2.2), seguridad de interfaz.
- §22 Stakeholders y producto: análisis de interesados, requisitos trazables,
  roadmap, comunicación.
- §23 Modelado de amenazas y testing: MITRE ATT&CK (mapeo tácticas/técnicas)
  y OSSTMM (canales, controles, métricas RAV).

Total: 23 secciones. Referenciado desde standards-lib.
Applies research findings (DevSecOps audit + Rizin/SQLite/Binary Ninja
benchmark) to the normative standard:

- §29 Enforcements y gobernanza de CI/CD: fail-closed (no continue-on-error,
  no fake exit 0), rulesets con 2 reviews para workflows/seguridad, auto-merge
  solo con checks verdes, supply-chain reproducible (lockfile hashes, SBOM en
  release, checksums de descargas, dependabot C/C++), integridad de releases
  (tags firmados, SLSA provenance, binarios firmados), testing avanzado
  (fuzzing en CI, coverage gate, DAST).
- §30 Contrato de módulos y API estable: libnoctua.so.1 con test ABI estilo
  SQLite, JSON canónico determinista por módulo (mirror C/Python con golden
  files), cadena de custodia evidence.json + custody.json + RFC3161.

Total: 30 secciones.
Research-driven extensions (OWASP LLM Top 10, EU AI Act, NIST 800-61 Rev.3,
CRA/DORA/NIS2/GDPR, EPSS/CISA KEV/CVSS 4.0, NIST SP 800-207):
- §31 Secure AI: prompt injection, tool poisoning, excessive agency,
  model/RAG poisoning, OWASP LLM Top 10, EU AI Act, agent governance.
- §32 Incident response: NIST 800-61 phases, playbooks, legal notification
  timelines (GDPR 72h, NIS2, DORA, CRA→ENISA).
- §33 Compliance: CRA, DORA, NIS2, GDPR art.25, MiCA/Travel Rule,
  privacy by design.
- §34 Vulnerability mgmt: EPSS + CISA KEV + CVSS 4.0 + SSVC, VEX,
  remediation SLAs.
- §35 Zero Trust operational: NIST 800-207, workload identity,
  microsegmentation, ZTNA.

Total: 35 secciones.
TimelineManager read observation_type (INTEGER column) as String,
failing every row and being silently dropped by filter_map. Use the
ObservationType FromSql impl (u8 -> enum) and stringify via Display.
AgentRegistry::register and unregister called flush() directly without
marking dirty, so agents were never written to agents.json. Save
immediately on both operations so registrations survive restarts.
… stub

Replace the synapsis-core Orchestrator stub (all methods return
defaults) with real implementations backed by the persistent
AgentRegistry and TaskQueue:

- ghost_audit creates a real task in the TaskQueue
- orchestrator_tree lists sub-agents via parent_agent_id metadata
- orchestrator_idle lists agents with Idle state
- agent_register accepts optional parent_agent_id for hierarchy
- McpServer::new(db) no longer takes the stub orchestrator; task_create
  and task_list are wired to the persistent TaskQueue with load() on
  startup

Update the three binary entry points and integration tests to the new
McpServer signature.
DiscoveryBridge::auto_configure wrote configs unconditionally using
current_exe(), so running discovery_scan from a test process (or any
non-synapsis binary) corrupted the user's ~/.config/opencode config by
pointing mcp.synapsis at the test binary.

- resolve_synapsis_mcp_path(): resolve the real synapsis-mcp binary
  instead of blindly using current_exe()
- auto_configure: only write configs when the process is a synapsis
  binary or SYNAPSIS_AUTOCONFIG_WRITE is set, otherwise skip writes
cargo-audit v0.22.2 fails to compile on rustc 1.95 (MSRV), which broke
the Security audit job (audit-check installs it via cargo install). Use
taiki-e/install-action to fetch the precompiled 0.21 release binary,
which is MSRV 1.95 compatible and avoids the build failure.
- Security audit: rustsec advisory RUSTSEC-2026-0109 uses CVSS v4 which
  cargo-audit 0.21 cannot parse, aborting the whole scan. Use the
  precompiled 0.22.2 binary (CVSS v4 support) via taiki-e/install-action.
- Test (Windows): synapsis-core enables rusqlite bundled-sqlcipher, and
  libsqlite3-sys requires OPENSSL_DIR on Windows. Install openssl via
  vcpkg and export OPENSSL_DIR/OPENSSL_INCLUDE_DIR/OPENSSL_LIB_DIR before
  cargo check.
lopdf (RUSTSEC-2026-0187) and ring 0.16 (RUSTSEC-2025-0009) are
transitive deps of the optional Arca wallet feature (via printpdf),
which is not enabled by default. The Security audit now runs correctly
(cargo-audit 0.22.2, CVSS v4) and these are the only findings; ignore
them since the feature is optional.
Implement context-aware toolcalling memory management:

- mem_save now dedups: find_similar_observation matches by content_hash
  (same project) then by normalized title, and revises the existing
  observation (bump revision_count, update hash+FTS) instead of inserting
  a duplicate.
- auto_save_observation (per-tool-call snapshot) uses the same dedup, so
  repeated "tool:<name>" observations update instead of stacking.
- New periodic watchdog thread in McpServer::run persists a heartbeat
  observation every SYNAPSIS_AUTO_SAVE_MINUTES (default 15), also
  deduplicated, so long-lived sessions keep a single evolving context
  record.

Adds Database::find_similar_observation and Database::revise_observation.
@MethodWhite
MethodWhite merged commit 0a9c14e into main Aug 12, 2026
34 of 37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant