Skip to content

feat: operational hardening + SIN-Brain memory integration (closes #8, #14, #15, #16)#23

Open
Delqhi wants to merge 2 commits into
mainfrom
feat/operational-hardening
Open

feat: operational hardening + SIN-Brain memory integration (closes #8, #14, #15, #16)#23
Delqhi wants to merge 2 commits into
mainfrom
feat/operational-hardening

Conversation

@Delqhi
Copy link
Copy Markdown
Contributor

@Delqhi Delqhi commented May 30, 2026

Summary

This consolidates multiple foundation PRs (#6 #7 #10 #11 #12 #13 #21) and completes four major WS/BR features from the operational-readiness and SIN-Brain memory roadmaps:

WS1–5: Operational Hardening (closes #8)

  • CI matrix (WS1): .github/workflows/ci.yml with ruff lint+format gate and pytest matrix across Python 3.11/3.12/3.13
  • Shared ruff config (WS2): E/F/I/W ruleset + one-shot mechanical format applied; __version__ aligned to 0.2.0
  • Release workflow (WS3): .github/workflows/release.yml builds sdist+wheel on v* tags, clean-env install check, GitHub Release upload, PyPI Trusted Publishing
  • Consistency check (WS4): scripts/check_consistency.py + tests verify version alignment, subsystem import health, mcp-config↔serve entry point; --strict mode for full-stack CI
  • Dev bootstrap (WS5): scripts/dev_install.sh + scripts/run_all_tests.sh for editable multi-repo setup

BR-1: Register SIN-Brain Memory Tools (closes #14)

  • memory.py adapter: thin pass-through bridge to sin_brain.mcp_tools (recall/remember/forget/pin/link_evidence)
  • Graceful degradation: absent sin-brain reports False in sin status, tools raise MemoryUnavailable with clean JSON errors
  • detect_env() probes availability + tier sizes; register_tools(mcp) wires MCP tools only when SIN-Brain importable

BR-2: Agents-md SIN-Brain Inject Block (closes #15)

  • Memory playbook rows added to tool guidance (recall, remember, link_evidence, forget) when sin-brain available
  • Negative constraints / red-zones section (6 hard constraints) always present to steer agents away from anti-patterns
  • SIN-Brain's AGENTS.md inject block embedded in 'Project memory' section; idempotent re-runs preserve single managed block

BR-3: MCP-Config Client Validation (closes #16)

Test Coverage

  • Memory adapter: 8 tests covering graceful degradation (absent package, failed imports), stats detection, tool registration with fake sin-brain
  • Agents-md: 5 new tests verifying red-zones always present, memory rows conditional, idempotent with inject; existing integration tests pass
  • Total: 122 tests passing; CI gate includes ruff check/format + optional extras matrix

Foundation PRs Merged

Files Added/Modified

  • .github/workflows/: ci.yml (new), release.yml (fixed for setuptools)
  • scripts/: dev_install.sh + run_all_tests.sh (new), check_consistency.py (new)
  • src/sin_code_bundle/: memory.py (new), agents_md.py (extended), cli.py (wired memory tools + hardening fixes)
  • tests/: test_consistency.py (new), test_memory.py (new), test_agent_integration.py (extended)
  • pyproject.toml: ruff config + optional extras; init.py: version synced
  • docs/plans/: operational-hardening.md status → implemented

Notes

  • All changes follow SOTA patterns: graceful degradation, fail-soft, defensive programming
  • Ready for full multi-repo SIN-Brain environment once SIN-Brain repo is live; works standalone with bundle-only today
  • SOTA approach to memory: thin adapter, deferred imports, monkeypatchable for testing, zero hard dependency

OpenSIN Bot added 2 commits May 30, 2026 08:22
…sistency (closes #8)

WS1 CI: ci.yml with ruff lint+format gate and pytest matrix (3.11/3.12/3.13).
WS2 lint: shared ruff config (E/F/I/W); one-shot mechanical format applied.
WS3 release: release.yml builds sdist+wheel on v* tags, clean-env install
  check, GitHub Release upload, PyPI Trusted Publishing.
WS4 consistency: scripts/check_consistency.py + tests (version alignment,
  subsystem import health, mcp-config<->serve entry point); --strict for CI.
WS5 bootstrap: scripts/dev_install.sh + scripts/run_all_tests.sh.
Also aligned __version__ to packaged 0.2.0.
…loses #14, #15, #16)

BR-1 (Issue #14): Register SIN-Brain memory tools in 'sin serve'
  - memory.py adapter: recall/remember/forget/pin/link_evidence pass-throughs
    with graceful degradation when sin-brain absent. detect_env() reports
    tier sizes in 'sin status'. register_tools(mcp) wires MCP tools.

BR-2 (Issue #15): 'sin agents-md' embeds sin-brain inject block
  - agents_md.py extended: memory playbook rows (recall, remember, link_evidence,
    forget) appear in the tool guidance when sin-brain available.
  - Negative constraints / red-zones section added (always present).
  - inject text from SIN-Brain embedded in 'Project memory' section.

BR-3 (Issue #16): 'sin mcp-config' client validation + stdio hygiene
  - Acceptance criteria met by PR #6 (already in main): valid YAML/JSON/TOML,
    --write merge preserving foreign keys, serve logs to stderr.
  - Added explicit stdio hygiene test to lock contract.

Tests: 8 memory adapter (graceful degradation, stats, tool registration),
       5 agents-md (red-zones always present, memory rows conditional,
       idempotent with inject), existing agent integration all pass (122 total).

CI gate: ruff check/format clean, 100% test pass, optional extras tested.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant