Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ labels: bug

## Expected behavior

<!-- What you expected to happen, with reference to README, DESIGN.md, ARCHITECTURE.md, cma-mcp/docs/MCP_SERVER.md, or a specific primitive/tool. -->
<!-- What you expected to happen, with reference to README, docs/DESIGN.md, docs/ARCHITECTURE.md, cma-mcp/docs/MCP_SERVER.md, or a specific primitive/tool. -->

## Actual behavior

Expand Down
5 changes: 1 addition & 4 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Security issue
url: https://github.com/Clarethium/cma/security/advisories/new
url: https://github.com/lluvr/cma/security/advisories/new
about: Report security issues via GitHub private vulnerability reporting per SECURITY.md. Do NOT open public issues for vulnerabilities.
- name: Lodestone methodology question
url: https://github.com/Clarethium/lodestone/issues
about: Methodology canon questions (FM catalog, surface protocols, compound practice) live with Lodestone.
9 changes: 5 additions & 4 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ labels: enhancement

<!--
For bash cma: command surface (flags, output format, exit codes).
Mirror DESIGN.md conventions (kebab-case flags, JSONL outputs where
Mirror docs/DESIGN.md conventions (kebab-case flags, JSONL outputs where
appropriate).

For cma-mcp: tool / resource name, parameters, returned payload
Expand All @@ -32,10 +32,11 @@ snake_case fields, optional `surface` label, `maxLength` on every
string field).
-->

## Companion impact
## Related-project impact

<!--
Does this require a parallel change in the other component, in
DESIGN.md / ARCHITECTURE.md / DATA.md / docs/MCP_SERVER.md, or in
any companion repo (Lodestone, Touchstone)? If yes, name what.
docs/DESIGN.md / docs/ARCHITECTURE.md / docs/DATA.md /
cma-mcp/docs/MCP_SERVER.md, or in any paired methodology? If yes,
name what.
-->
22 changes: 11 additions & 11 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<!--
Thanks for contributing. Read CONTRIBUTING.md and GOVERNANCE.md
Thanks for contributing. Read CONTRIBUTING.md and docs/GOVERNANCE.md
before opening a substantial change. Especially:

- Sign every commit with DCO: `git commit -s`
- Run the relevant test suite before pushing:
- bash cma: `./test.sh`
- bash cma: `./scripts/test.sh`
- cma-mcp: `python3 -m pytest -q` from `cma-mcp/`
- Check whether your change contradicts a prior DECISIONS.md entry;
- Check whether your change contradicts a prior docs/DECISIONS.md entry;
if so, the PR description must name the contradiction.
-->

Expand All @@ -28,31 +28,31 @@ before opening a substantial change. Especially:
- [ ] Surface-breaking change (major version bump)
- [ ] Documentation only
- [ ] Test addition / refactor
- [ ] Architectural decision (DECISIONS.md entry added)
- [ ] Architectural decision (docs/DECISIONS.md entry added)

## Reviewer checklist

- [ ] DCO sign-off on every commit (`git log` shows `Signed-off-by:` trailer)
- [ ] Relevant test suite passes locally
- [ ] If bash cma surface changed: `cma`, `test.sh`, `DESIGN.md`, and `ARCHITECTURE.md` (if action-time injection touched) updated together
- [ ] If bash cma surface changed: `cma`, `scripts/test.sh`, `docs/DESIGN.md`, and `docs/ARCHITECTURE.md` (if action-time injection touched) updated together
- [ ] If cma-mcp surface changed: `mcp_schema.py`, `mcp_server.py`, the relevant test, and `cma-mcp/docs/MCP_SERVER.md` updated together
- [ ] If payload shape changed: `cma-mcp/tests/test_payload_determinism.py` updated
- [ ] If runtime behavior changed: the relevant CHANGELOG `[Unreleased]` updated
- [ ] No new runtime dependency added (bash cma: bash + python3 stdlib only; cma-mcp: Python stdlib only)
- [ ] `bash scripts/canon_audit.sh` passes locally

## Companion-link impact
## Related-project impact

<!--
Does this change affect references to Lodestone, Touchstone, or any
other companion repo? If yes, name what coordinates with each. If
no, write "none".
Does this change affect references to Touchstone, frame-check,
Lodestone, or any related project? If yes, name what coordinates with
each. If no, write "none".
-->

## DECISIONS

<!--
If this PR adds a DECISIONS.md entry, paste the AD-NNN block here.
If this PR contradicts a prior DECISIONS.md entry, name the
If this PR adds a docs/DECISIONS.md entry, paste the AD-NNN block here.
If this PR contradicts a prior docs/DECISIONS.md entry, name the
contradiction and the reason.
-->
14 changes: 10 additions & 4 deletions .github/workflows/publish-mcp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
# 3. Push tag `cma-mcp-X.Y.Z`.
# 4. Approve the deployment in the GitHub Actions UI when the
# reviewer-required gate fires on the `pypi` environment.
# 5. Create a GitHub Release at the tag so the GitHub-Zenodo
# integration mints a versioned DOI.
# 6. Update `cma-mcp/CITATION.cff` with the issued DOI under
# `identifiers:` and bump `doi:` to the versioned DOI.
# 5. If the GitHub-Zenodo integration is enabled for this
# repository, create a GitHub Release at the tag so it mints a
# versioned DOI.
# 6. When a DOI is issued, record it in `cma-mcp/CITATION.cff`
# under `identifiers:` (and set a top-level `doi:` to it).
#
# A TestPyPI upload step is available as a commented job below
# (`publish-to-testpypi`); swap the comment blocks and add
Expand Down Expand Up @@ -196,3 +197,8 @@ jobs:
name: cma-mcp-dist
path: dist/
- uses: pypa/gh-action-pypi-publish@release/v1
with:
# PEP 740 attestations back the provenance-verification path
# documented in SECURITY.md. Set explicitly rather than relying
# on the action default so the guarantee cannot silently regress.
attestations: true
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
run: python3 --version

- name: Run test suite
run: ./test.sh
run: ./scripts/test.sh

lint:
runs-on: ubuntu-latest
Expand All @@ -41,8 +41,8 @@ jobs:
- name: Lint cma and hooks
run: |
shellcheck cma
shellcheck test.sh
shellcheck bench.sh
shellcheck scripts/test.sh
shellcheck scripts/bench.sh
shellcheck hooks/cma-pre
shellcheck hooks/claude-code-pre-tool-use.sh
shellcheck hooks/claude-code-session-start.sh
2 changes: 1 addition & 1 deletion .github/workflows/tests-mcp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
- name: Run pytest with coverage
# Coverage measurement scopes the eight runtime modules per
# [tool.coverage.run] in pyproject.toml. The reported number
# reflects in-process dispatch only `tests/test_mcp_wire.py`
# reflects in-process dispatch only: `tests/test_mcp_wire.py`
# spawns cma-mcp as a real subprocess (closes ANTICIPATED_
# CRITIQUES C-8), and pytest-cov does not follow subprocess
# paths without a sitecustomize hook. Lines exercised only
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ coverage.xml
*.swo
*~

# linters / agent-local config (per-developer, never committed)
.ruff_cache/
.claude/settings.local.json

# os
.DS_Store
Thumbs.db
Expand Down
16 changes: 16 additions & 0 deletions .gitleaks.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,22 @@ title = "cma gitleaks configuration"
# these, do not replace.
useDefault = true

# The canon-discipline detector and its self-test fixtures are the
# files explicitly allowed to name the forbidden patterns (in order to
# detect or self-verify them). They therefore trip the custom rules
# below by construction: `canon_audit.sh` matches the *AUDIT* filename
# shape, and `canon_audit_known_leaks.txt` deliberately carries
# leak-shaped strings (including a /home/ path) to exercise the
# detector. Exempt them from all rules, consistent with the public-canon
# discipline's own path allowlist.
[allowlist]
description = "Canon-discipline detector and self-test fixtures may name forbidden patterns"
paths = [
'''scripts/canon_audit\.sh''',
'''scripts/canon_audit_known_leaks\.txt''',
'''scripts/canon_audit_pystring_concat_known_leaks\.py''',
]

# Refuse commits matching common agent-handoff scratchpad filename
# patterns. These files are scratch space and should never enter
# version control regardless of content.
Expand Down
18 changes: 9 additions & 9 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,26 @@ or `.cursorrules` is. Read it before making changes.

## What this repo is

`Clarethium/cma` is the public canonical repository for **cma**
`lluvr/cma` is the public canonical repository for **cma**
(executable compound practice loop) plus its MCP wrapper at
`cma-mcp/`. The bash CLI at the repo root is the load-bearing
implementation; the Python MCP wrapper at `cma-mcp/` is a thin
distribution surface. They ship together because every cma flag is a
cma-mcp tool argument and every JSONL field in `surface_events.jsonl`
is a cma-mcp parser concern; same-repo prevents drift structurally.

The decision is codified in `DECISIONS.md` AD-008. If you are
The decision is codified in `docs/DECISIONS.md` AD-008. If you are
proposing structural changes, read AD-008 first.

## What goes in this repo

This repository ships only what an adopter needs to install, run,
extend, and audit CMA. The scope is fixed:

- The bash CLI and its `test.sh` suite.
- The bash CLI and its `scripts/test.sh` suite.
- The `cma-mcp/` Python wrapper, its tests, and the wheel metadata.
- `README.md`, `CONTRIBUTING.md`, `GOVERNANCE.md`, `SECURITY.md`,
`CHANGELOG.md`, `LICENSE`, `CITATION.cff`, `DECISIONS.md`.
- `README.md`, `CONTRIBUTING.md`, `docs/GOVERNANCE.md`, `SECURITY.md`,
`CHANGELOG.md`, `LICENSE`, `CITATION.cff`, `docs/DECISIONS.md`.
- `AGENTS.md` (this file) at the root.

Anything outside that scope does not enter the repository. The
Expand Down Expand Up @@ -93,7 +93,7 @@ with a placeholder marker; the marker itself is a leak.

- DCO sign-off required (`git commit -s ...`). The `dco-check`
workflow blocks merges of unsigned commits.
- Bash CLI tests run via `./test.sh` at the repo root. MCP wrapper
- Bash CLI tests run via `./scripts/test.sh` at the repo root. MCP wrapper
tests live under `cma-mcp/tests/` and run via
`pytest cma-mcp/tests/`. Both must pass before merging.
- Style: no em-dashes, en-dashes, smart quotes, or curly apostrophes
Expand All @@ -108,7 +108,7 @@ with a placeholder marker; the marker itself is a leak.
## Pointers for further reading

- `README.md`: what CMA is and how to use it.
- `DECISIONS.md`: durable architectural decisions (AD-001 through
- `docs/DECISIONS.md`: durable architectural decisions (AD-001 through
AD-008).
- `CONTRIBUTING.md`: PR flow, sign-off, style.
- `SECURITY.md`: vulnerability disclosure.
Expand All @@ -119,8 +119,8 @@ with a placeholder marker; the marker itself is a leak.
Beyond the file shapes above, certain phrasings always leak. These never appear in committed content (with the exception of this AGENTS.md, the canon audit script `scripts/canon_audit.sh`, and its two self-test fixtures `scripts/canon_audit_known_leaks.txt` and `scripts/canon_audit_pystring_concat_known_leaks.py`, which are allowed to name the patterns in order to forbid or self-verify them):

- `maintainer-side`, `maintainer-internal` (any compound).
- `the operator's [strategy|methodology|notes|vault|workspace|tree|dev tree|bet|stake|positioning]` also when an adjective intervenes (`the operator's research vault`).
- Bare `operator [paper|study|playbook|doctrine|memo|brief]` these artifact-shape words name a written artifact authored by "the operator" and are unambiguously leak-shaped.
- `the operator's [strategy|methodology|notes|vault|workspace|tree|dev tree|bet|stake|positioning]`, also when an adjective intervenes (`the operator's research vault`).
- Bare `operator [paper|study|playbook|doctrine|memo|brief]`: these artifact-shape words name a written artifact authored by "the operator" and are unambiguously leak-shaped.
- Practitioner-sense `operator` compounds: `operator [methodology|framework|practice|discipline|skill|stance]`, `multi-operator`, `operator-AI`, and `the operator's [loop|stance|skill|judgment|contribution|disposition|perspective|choice|workflow|discipline]`. "operator" was retired from public content in favor of "builder" (the person), second person for direct address, or dropped where it read as filler; these compounds are leaks. Bare `operator` in unrelated literal senses (cloud operators, the Python `operator` module, mathematical operators) is fine. The fresh-reader test catches any practitioner-sense recurrence the patterns miss.
- Any definite reference to `vault` as a body of operator material: `the vault`, `in the vault`, `from the vault`. Also forbidden as terms of art: `vault-faithful`, `vault-validated`, `vault behaviour`, `vault precision threshold`, `vault notes`. Allowed only in domain compounds where `vault` is unrelated (`password vault`, `secrets vault`, `hashicorp vault`, `key vault`).
- Sanitization-shape parentheticals: `(see private)`, `(internal reference)`, `(maintainer-side reference)`, `(see maintainer-side ...)`.
Expand Down
18 changes: 12 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and

## [Unreleased]

### Changed

- Repository home moved to a personal account (`lluvr/cma`). Self-references, badges, and issue/security links updated; author and publisher framing is now personal (organization publisher attribution dropped).
- Zenodo DOI references removed from `CITATION.cff` pending re-issuance under the new account; `SECURITY.md`'s publisher-identity claim softened accordingly.
- Repository layout: the deep-dive docs (`DESIGN`, `ARCHITECTURE`, `DATA`, `DECISIONS`, `GOVERNANCE`) moved under `docs/`, and `test.sh` / `bench.sh` moved under `scripts/`. All internal references updated.

---

## [1.1.0] - 2026-05-25
Expand All @@ -20,7 +26,7 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and

## [1.0.0] - 2026-05-15

cma 1.0 reference implementation. The surface defined in [DESIGN.md](DESIGN.md) is locked and complete.
cma 1.0 reference implementation. The surface defined in [DESIGN.md](docs/DESIGN.md) is locked and complete.

### Surface

Expand All @@ -36,7 +42,7 @@ cma 1.0 reference implementation. The surface defined in [DESIGN.md](DESIGN.md)

### Action-time injection

- Five-stage architecture (interception, context extraction, query, injection, logging) specified in [ARCHITECTURE.md](ARCHITECTURE.md). Reference implementations:
- Five-stage architecture (interception, context extraction, query, injection, logging) specified in [ARCHITECTURE.md](docs/ARCHITECTURE.md). Reference implementations:
- Claude Code: `hooks/claude-code-pre-tool-use.sh` (per-action surfacing) and `hooks/claude-code-session-start.sh` (session priming with recurrence + active rejections, optionally behavior pivots).
- Shell: `hooks/cma-pre` for zsh (native `preexec`) and bash (via `bash-preexec`), with manual-wrap support.
- Failure-isolated: hook errors never block the wrapped action; 5-second timeout on cma queries.
Expand Down Expand Up @@ -64,10 +70,10 @@ cma 1.0 reference implementation. The surface defined in [DESIGN.md](DESIGN.md)

### Documentation

- [DESIGN.md](DESIGN.md): seven-primitive surface, argument semantics, output expectations.
- [ARCHITECTURE.md](ARCHITECTURE.md): five-stage action-time injection contract, data shapes, validation framework, quality criteria for integrations.
- [DATA.md](DATA.md): per-record-type schemas with examples, schema versioning policy, atomicity guarantees, tolerant-read behavior, storage requirements, backup recommendations, migration policy.
- [DECISIONS.md](DECISIONS.md): architectural decision records.
- [DESIGN.md](docs/DESIGN.md): seven-primitive surface, argument semantics, output expectations.
- [ARCHITECTURE.md](docs/ARCHITECTURE.md): five-stage action-time injection contract, data shapes, validation framework, quality criteria for integrations.
- [DATA.md](docs/DATA.md): per-record-type schemas with examples, schema versioning policy, atomicity guarantees, tolerant-read behavior, storage requirements, backup recommendations, migration policy.
- [DECISIONS.md](docs/DECISIONS.md): architectural decision records.

### Roadmap

Expand Down
40 changes: 7 additions & 33 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
cff-version: 1.2.0
message: >-
If you use cma in academic, applied, or compliance work, please
cite it using the metadata below. The methodology canon
(Lodestone) and the MCP distribution wrapper (cma-mcp, in this
repository under cma-mcp/) are separately citeable artifacts;
see the references block.
cite it using the metadata below. The MCP distribution wrapper
(cma-mcp, in this repository under cma-mcp/) is a separately
citeable artifact; see the references block.
title: "cma: executable compound practice loop"
type: software
authors:
- family-names: Lucic
given-names: Lovro
orcid: "https://orcid.org/0009-0008-9976-6933"
website: "https://blog.clarethium.com"
repository-code: "https://github.com/Clarethium/cma"
url: "https://github.com/Clarethium/cma"
repository-code: "https://github.com/lluvr/cma"
url: "https://github.com/lluvr/cma"
abstract: >-
cma is the executable companion to Lodestone, Clarethium's
canonical methodology for AI-coupled work. cma runs the
compound practice loop on your local machine: it
cma runs the compound practice loop on your local machine: it
captures failures, surfaces relevant prior context at the moment
of action, tracks decisions and rejected alternatives, detects
recurrence, and captures preventions. Action-time injection ships
Expand All @@ -31,44 +28,21 @@ keywords:
- decision-tracking
- prevention
- lodestone
- clarethium
license: Apache-2.0
version: "1.1.0"
date-released: "2026-05-25"
doi: "10.5281/zenodo.20066625"
identifiers:
- type: doi
value: "10.5281/zenodo.20066625"
description: "Concept DOI; resolves to the latest release in this repository (cma or cma-mcp)"
- type: doi
value: "10.5281/zenodo.20232904"
description: "Versioned DOI for cma 1.0.0"
references:
- type: software
title: "cma-mcp: Model Context Protocol distribution for the cma compound practice loop"
authors:
- family-names: Lucic
given-names: Lovro
orcid: "https://orcid.org/0009-0008-9976-6933"
url: "https://github.com/Clarethium/cma/tree/main/cma-mcp"
url: "https://github.com/lluvr/cma/tree/main/cma-mcp"
license: Apache-2.0
notes: >-
Lives in this repository under cma-mcp/. Brings the same
compound practice loop to MCP-compatible AI clients (Claude
Desktop, Cursor, Cline, Continue.dev) by wrapping cma's CLI
as a subprocess. See cma-mcp/CITATION.cff for its citable
form.
- type: article
title: "Lodestone: canonical methodology for AI-coupled work"
authors:
- family-names: Lucic
given-names: Lovro
orcid: "https://orcid.org/0009-0008-9976-6933"
url: "https://github.com/Clarethium/lodestone"
license: CC-BY-4.0
notes: >-
The methodology canon Clarethium publishes alongside cma.
Defines stance, the loop, calibration, altitude, failure
shapes, quality levels, surface protocols, and compound
practice (Section VIII). cma is the executable instantiation
of Lodestone Section VIII.
Loading
Loading