This release includes 1 security fix for security teams reviewing exposed deployments.
Topics
+14 more
Affected surfaces
Summary
AI summaryAdds 14 lint dimensions, four core helpers, and enforces R6 write‑surface discipline.
Full changelog
Cleanup + discipline-enforcement release. Grows the lint surface from 11 → 25 dimensions, lands four foundation helpers (atomic writes, trust sanitisation, skip-dirs, write-surface), wires R6 ("write only to allowed surface") into every substrate-mutating verb, and closes 13+ concrete audit-surfaced bugs.
Highlights
14 new lint dimensions (11 → 25)
- Plugin purity:
MP2(companion to MP1 for.myco/plugins/) - Documentation hygiene:
DC1-DC4(module / function / class / doctrine-link docstrings) - Contract health:
CS1(fixable HIGH —synced_contract_versiondrift) - Substrate invariants:
FR1(HIGH/MEDIUM — fresh-substrate dirs),PA1(MEDIUM —write_surfacecoverage) - Graph integrity:
SE3(LOW — self-cycle),CG1/CG2(LOW — code ↔ doctrine link) - Backlog + rules:
MB3(fixable HIGH — raw-notes ≥ 50),RL1(LOW — R1-R7 referenced) - Discipline:
DI1(MEDIUM —.claude/hooks.jsonpresent)
Four foundation helpers under src/myco/core/
io_atomic.py—atomic_utf8_write(temp + fsync + os.replace),bounded_read_text,bounded_read_bytes(10 MB default cap)trust.py—strip_controls,flatten_newlines,safe_frontmatter_field,markdown_inline_safeskip_dirs.py— canonicalDEFAULT_SKIP_DIRS+should_skip_dir/should_skip_path(unifies 3 divergent lists)write_surface.py—is_path_allowed,guarded_write,check_write_allowed,unsafe_bypass_enabled,WriteSurfaceViolation
R6 mechanical enforcement
Every verb that mutates substrate content now routes through check_write_allowed or guarded_write:
eat→notes/raw/sporulate→notes/distilled/digest/assimilate→notes/integrated/+_canon.yamlfruit→docs/primordia/ramify→src/or.myco/plugins/boot_brief→ entry pointmolt→_canon.yaml+docs/contract_changelog.md
Misplaced writes raise WriteSurfaceViolation (exit 3) with a diagnostic, respecting the MYCO_ALLOW_UNSAFE_WRITE env bypass.
13+ audit-driven fixes
- Lens 6 (security):
.envremoved from text adapter; credential filename denylist (*.env,id_rsa*,*.pem,.npmrc, etc.); adapter size caps at 10 MB; SSRF guard + response byte-cap inurl_fetcher(scheme allowlist, resolves loopback/link-local/private hosts to a refusal, redirect targets re-validated) - Lens 7: forage walker prunes skip-dirs mid-DFS + short-circuits at MAX_ITEMS (5.5-6.4s → <400 ms on Myco self)
- Lens 10: LF-only line endings at every
write_textsite; POSIX source normalisation in adapters;.gitattributescommitted;.pre-commit-config.yaml,src/myco/py.typedshipped - Lens 11: MCP pulse canon cache (mtime-keyed) so repeated tool calls share the parsed canon; pulse scalars sanitised via
safe_frontmatter_field - Lens 13: symlink cycle guard in
_walk_py+ fingerprint walker; fresh substrates pre-createnotes/raw/+notes/integrated/ - Lens 16: SE1 switched from per-edge
stat(2)toedge.dst in graph.nodes(2400× speedup on Myco self) - Concurrency:
eat.append_noteusesos.open(O_EXCL)in a retry loop (TOCTOU fix) - YAML injection:
_render_noteswitched toyaml.safe_dump+ field-level trust sanitisation - Windows: reserved-name guard on germinate's
substrate_id/entry_point; explicitencoding="utf-8"onsubprocess.run(..., text=True)for cp936 locale - Migration:
_ContractVersionDescriptorreadsmyco.__version__at call time (was stale constant);moltincrementswaves.currentmonotonically
Exit-code differentiation
All stay in the ≥3 operational-failure band (contract-compliant):
SubstrateNotFound.exit_code:3→4CanonSchemaError.exit_code:3→5
Scripts checking exit != 0 are unaffected; scripts special-casing == 3 for substrate/canon failures get a more precise signal.
Bitter-lesson refactors
clients.py: 7 near-identical JSON installers → oneJsonClientSpecdata table. New host = 1 row, not 5 lines.- MP1
BLACKLIST: audited + extended with 17 providers (14 → 31): langchain integrations, Together, Fireworks, Groq, DeepSeek, Zhipu, Replicate, HuggingFace Hub, LiteLLM, AISuite, PortkeyAI, Instructor, Guidance, DSPy.
Tests
- 613 → 755 (+142)
- 4 dedicated foundation-helper test modules (
test_io_atomic,test_trust,test_write_surface,test_skip_dirs) - 14 new dimension test modules (one per new dim)
- Property tests: atomicity (interleaved read-never-torn), encoding round-trip, bypass env truthy/falsy parsing, sample-path coverage for PA1
Upgrading from v0.5.7
Fully backwards-compatible in the common path. Two notes for operators whose substrate deviates from defaults:
- Exit codes: if you shelled out to Myco and special-cased
exit == 3for substrate-not-found / canon-schema errors, update to accept4/5. Scripts checkingexit != 0need no change. - Write surface: if your
_canon.yaml::system.write_surface.alloweddoes NOT cover a path a verb wants to write to, the verb now fails cleanly instead of silently writing. Runmyco immune→PA1will tell you which samples aren't covered. Add the missing pattern(s) or setMYCO_ALLOW_UNSAFE_WRITE=1to override per-invocation.
Governing crafts
docs/primordia/v0_5_8_discipline_enforcement_craft_2026-04-21.md(14-dim expansion + foundation helpers design)docs/primordia/v0_5_8_release_craft_2026-04-21.md(release closure)
Gate status at release
- 755/755 pytest
- ruff / ruff format / mypy: all clean
- myco immune (default CI gate): exit 0
- myco immune --exit-on=high: exit 0 (all findings LOW)
- myco hunger: clean (no drift, no backlog, no reflex signals)
- python -m build + twine check: PASSED for both wheel + sdist
Security Fixes
- Lens 6 security fixes: `.env` files removed from text adapter, credential filename denylist (e.g., *.env, id_rsa*, *.pem, .npmrc), adapter size capped at 10 MB, SSRF guard with scheme allow‑list and response byte‑cap in `url_fetcher`
Weekly OSS security release digest.
The CVE patches and breaking changes that affected production tools this week. One email, every Sunday.
No spam, unsubscribe anytime.
Share this release
About Battam1111/Myco
Agent-first cognitive substrate with 18 manifest-driven verbs (germinate / eat / assimilate / sporulate / traverse / immune / molt / …) and 25 lint dimensions enforcing contract invariants mechanically (R1–R7). Cross-session / cross-project memory via a self-validating filesystem graph — AST + markdown-link derived, not embedding-based. Provider-agnostic by design: MP1/MP2 dims forbid LLM-SDK imports in the kernel and plugin tree. Editable-default install. Works with Claude Code, Cursor, Windsurf, Zed, VS Code, and any MCP client.
Related context
Related tools
Beta — feedback welcome: [email protected]