@convesoft/mara 0.3.0-alpha.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,170 +1,68 @@
1
1
  # Mara
2
2
 
3
- Mara keeps project knowledge in readable Markdown while giving requirements,
4
- designs, decisions, and other durable facts stable identities, types, relations,
5
- validation, and deterministic retrieval. A CLI and stdio MCP server share the
6
- same operations, including discovery of narrative outside items.
3
+ Mara keeps structured project knowledge in readable, Git-tracked Markdown.
4
+ The CLI and stdio MCP server share authoring, retrieval, validation and
5
+ traceability operations. Start with the [product documentation](docs/index.mara.md)
6
+ and [Mara skill](skills/mara/SKILL.md).
7
7
 
8
- This checkout adds typed inline relationships, metadata inverse aliases,
9
- symmetric relationships, and occurrence inspection to the unified `search`,
10
- `get`, and `related` workflow.
11
- It requires schema format 3 and emits discovery format 2. Follow the
12
- [relationship migration contract](docs/relations.mara.md) for existing projects.
13
- Published 0.2.0 still uses schema format 2 and discovery format 1; use its
14
- [documentation](https://github.com/convesoft/mara/tree/v0.2.0) and matching skill.
8
+ ## Run
15
9
 
16
- ## Run Mara
17
-
18
- Build the implementation described here with the pinned Rust toolchain:
10
+ Build from this checkout with the pinned Rust toolchain:
19
11
 
20
12
  ```bash
21
13
  cargo build --locked --release
22
14
  ./target/release/mara --help
23
15
  ```
24
16
 
25
- The examples below use `mara` to mean this executable or an installed version
26
- that exposes the same interface. Register its absolute path for MCP. The
27
- checkout's version string alone does not establish which unreleased changes
28
- an older published prerelease includes; check its help and matching release
29
- notes before using the 0.2 workflow.
30
-
31
- Published npm packages contain prebuilt native binaries and use no install
32
- scripts or Rust toolchain. Run the stable 0.2.0 version:
17
+ For a published release, replace `<version>` with its exact version:
33
18
 
34
19
  ```bash
35
- npx -y '@convesoft/mara@0.2.0' --version
36
- npx -y '@convesoft/mara@0.2.0' --help
37
- ```
38
-
39
- Keep that exact pin in CLI and MCP launchers. Supported hosts are x64 and
40
- arm64 macOS, plus x64 and arm64 Linux compatible with Ubuntu 22.04's glibc
41
- baseline. Distribution guarantees are in
42
- [distribution and release](docs/distribution.mara.md).
43
-
44
- ## Configure an MCP client
45
-
46
- For a client that starts stdio servers in the project directory:
47
-
48
- ```toml
49
- [mcp_servers.mara]
50
- command = "/absolute/path/to/mara"
51
- args = ["mcp"]
52
- ```
53
-
54
- To bind the server to one project regardless of its execution directory:
55
-
56
- ```toml
57
- [mcp_servers.mara]
58
- command = "/absolute/path/to/mara"
59
- args = ["mcp", "--project", "/absolute/path/to/project"]
20
+ npx -y '@convesoft/mara@<version>' --help
60
21
  ```
61
22
 
62
- For npm, use `command = "npx"` and prepend `"-y"` and
63
- `"@convesoft/mara@<version>"` to the arguments after substituting the exact pin.
64
- Without `--project`, project-bound tools accept an absolute `project` path or
65
- discover the nearest `.mara/project.toml` from the server's execution directory.
66
- A bound server rejects request-level project overrides; omit that parameter.
67
-
68
- ## Configure Codex
69
-
70
- Register the executable and install [the Mara skill](skills/mara/SKILL.md)
71
- separately from the same checkout or release:
23
+ The npm package runs a prebuilt binary without install scripts or a Rust toolchain.
24
+ Supported platforms and package contents are defined in
25
+ [distribution](docs/distribution.mara.md).
26
+ For existing projects and clients, follow the [0.3 migration guide](docs/migration-0.3.mara.md).
72
27
 
73
- ```bash
74
- codex mcp add mara -- /absolute/path/to/mara mcp
75
- ```
28
+ ## Configure an agent
76
29
 
77
- Install the `skills/mara` directory through your client's skill installation
78
- workflow. Installing the skill does not install an executable; it reuses the
79
- configured MCP launcher for CLI fallback. For a published version, the npm
80
- package contains the matching skill as well as optional portable Agent Plugins
81
- 1.0 metadata and MCP configuration.
30
+ Configure your MCP client to launch `/absolute/path/to/mara` with arguments
31
+ `["mcp", "--project", "/absolute/path/to/project"]`. For npm, launch `npx` with
32
+ `["-y", "@convesoft/mara@<version>", "mcp", "--project", "/absolute/path/to/project"]`.
33
+ Use the same exact version for CLI and MCP. A bound server uses that project;
34
+ omit per-call project overrides.
82
35
 
83
- Compatible clients may install the complete package through the Convesoft
84
- marketplace as a convenience:
36
+ Install the standalone skill separately from the matching checkout or extracted
37
+ npm package:
85
38
 
86
39
  ```bash
87
- codex plugin marketplace add convesoft/mara
88
- codex plugin add mara@convesoft
40
+ npx skills add /absolute/path/to/mara-package --skill mara
89
41
  ```
90
42
 
91
- The complete plugin is not a release compatibility target. Do not install it
92
- alongside an equivalent manually configured Mara MCP server. Neither onboarding
93
- route modifies project `AGENTS.md`.
43
+ Select the intended agent and installation scope. The skill installer supports
44
+ [local sources and skill selection](https://github.com/vercel-labs/skills#install-a-skill).
45
+ Installing the skill does not install Mara; its CLI fallback reuses the configured
46
+ MCP executable or exact npm pin.
94
47
 
95
- ## Start authoring
48
+ ## Author knowledge
96
49
 
97
- Run this in a new project directory; `knowledge.mara.md` is created by the
98
- first item operation:
50
+ In a new project directory, using `mara` for the selected executable:
99
51
 
100
52
  ```bash
101
53
  mara project init --template engineering
102
- mara schema list flavour
103
54
  mara schema get flavour requirement
104
- mara schema get relation verifies
105
55
  mara item create requirement REQ-ACCESS knowledge.mara.md \
106
- --title "Permit access" --body "An authorized user can access the service."
107
- mara item create verification VER-ACCESS knowledge.mara.md \
108
- --title "Check access" \
109
- --body "Demonstrate that an authorized user can access the service." \
110
- --relation verifies=REQ-ACCESS
56
+ --title 'Permit access' --body 'An authorized user can access the service.' \
57
+ --field status=draft
111
58
  mara project validate
112
- ```
113
-
114
- `minimal` remains the default template; `empty` declares no vocabulary.
115
- `engineering` supplies engineering flavours and traceability relations.
116
- Templates create configuration and an editable schema only. Before creating an
117
- item, use the flavour's `description`, `use_when`, `avoid_when`, and
118
- `distinguish_from` to choose appropriate knowledge, then inspect its ID prefix,
119
- body, and field constraints. These guidance keys belong to the schema, not
120
- item metadata. See [guided authoring](docs/guided-authoring.mara.md) for the
121
- schema contract and engineering relation meanings.
122
-
123
- ## Discovery and reading
124
-
125
- ```bash
126
- mara --format json search "authorized user"
59
+ mara --format json search 'authorized user'
127
60
  mara --format json get REQ-ACCESS
128
- mara --format json related REQ-ACCESS --direction incoming --relation verifies
129
- mara --format json get VER-ACCESS
130
- ```
131
-
132
- CLI and MCP use `search`, `get`, and `related`; MCP get/related take
133
- `{"reference":"REQ-ACCESS"}`. Search returns mixed item, section, and Markdown
134
- block hits with one excerpt each. Pass a hit's `node.reference` to get or
135
- related, then read selected `connections[].neighbour.reference` values.
136
- `node.context.parent` identifies direct structural context. Documents and
137
- sections can be read and navigated without client filesystem access.
138
-
139
- Repeat a paginated call with its `next_cursor` until `has_more:false`, keeping
140
- all other inputs unchanged. Get returns consecutive content and ordered item
141
- metadata fragments; search excerpts are only for selection. Search and related
142
- accept `limit`; get does not. Item filters exclude narrative; project-relative
143
- path filters cover all search result kinds. For response fields, relation
144
- namespaces, containment, and handle lifetime, see
145
- [the discovery contract](docs/discovery.mara.md).
146
-
147
- Item authoring, list, and validation remain under `item`; relation mutations
148
- write schema-defined item edges. Mentions and containment derive from Markdown.
149
- Editing rejects changes that break or retarget surviving internal links; resolve
150
- reported impacts before retrying. See [item editing](docs/editing.mara.md) and
151
- [Markdown links and mutation safety](docs/discovery.mara.md#item-mutation-and-link-safety).
152
- Use `mara --help` or `mara <command> --help` for command and argument guidance.
153
-
154
- ## Development
155
-
156
- ```bash
157
- cargo fmt --all -- --check
158
- cargo clippy --locked --all-targets --all-features -- -D warnings
159
- cargo test --locked --all-targets
160
- cargo run --locked --quiet -- --format json project validate
161
- scripts/smoke-npm.sh target/release/mara
162
61
  ```
163
62
 
164
- See [the documentation index](docs/index.mara.md), [ROADMAP.md](ROADMAP.md),
165
- [AGENTS.md](AGENTS.md), and [SECURITY.md](SECURITY.md).
166
-
167
- ## License
63
+ Inspect the schema before choosing a flavour or relation. See
64
+ [initialization and project context](docs/project.mara.md),
65
+ [retrieval](docs/retrieval.mara.md), and [trace matrices](docs/traceability.mara.md)
66
+ for their full contracts.
168
67
 
169
- Licensed under either [Apache License 2.0](LICENSE-APACHE) or the
170
- [MIT License](LICENSE-MIT), at your option.
68
+ Licensed under [MIT](LICENSE-MIT) or [Apache-2.0](LICENSE-APACHE).
package/bin/mara.cjs CHANGED
@@ -8,7 +8,6 @@ const { spawn } = require("node:child_process");
8
8
  const packages = new Map([
9
9
  ["linux:x64", "@convesoft/mara-linux-x64-gnu"],
10
10
  ["linux:arm64", "@convesoft/mara-linux-arm64-gnu"],
11
- ["darwin:x64", "@convesoft/mara-darwin-x64"],
12
11
  ["darwin:arm64", "@convesoft/mara-darwin-arm64"],
13
12
  ]);
14
13
 
@@ -18,7 +17,7 @@ const packageName = packages.get(platform);
18
17
  if (packageName === undefined) {
19
18
  console.error(
20
19
  `Mara does not provide a binary for ${process.platform}/${process.arch}. ` +
21
- "Supported targets are glibc Linux and macOS on x64 or arm64.",
20
+ "Supported targets are glibc Linux on x64 or arm64, and Apple Silicon macOS.",
22
21
  );
23
22
  process.exitCode = 1;
24
23
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@convesoft/mara",
3
- "version": "0.3.0-alpha.0",
3
+ "version": "0.3.0",
4
4
  "description": "Structured project knowledge CLI and MCP server",
5
5
  "author": "Aliaksei Raketski",
6
6
  "license": "MIT OR Apache-2.0",
@@ -18,16 +18,12 @@
18
18
  "node": ">=18"
19
19
  },
20
20
  "optionalDependencies": {
21
- "@convesoft/mara-linux-x64-gnu": "0.3.0-alpha.0",
22
- "@convesoft/mara-linux-arm64-gnu": "0.3.0-alpha.0",
23
- "@convesoft/mara-darwin-x64": "0.3.0-alpha.0",
24
- "@convesoft/mara-darwin-arm64": "0.3.0-alpha.0"
21
+ "@convesoft/mara-linux-x64-gnu": "0.3.0",
22
+ "@convesoft/mara-linux-arm64-gnu": "0.3.0",
23
+ "@convesoft/mara-darwin-arm64": "0.3.0"
25
24
  },
26
25
  "files": [
27
26
  "bin/mara.cjs",
28
- "bin/mara-plugin.cjs",
29
- "plugin.json",
30
- "mcp.json",
31
27
  "skills/mara/SKILL.md",
32
28
  "README.md",
33
29
  "LICENSE-MIT",
@@ -15,9 +15,9 @@ discovery format 2, relationship format 1, validation format 1, and trace
15
15
  format 1. Typed inline relationships, inverse aliases, symmetric edges,
16
16
  external targets, graph policies, YAML current-state rules, and matrices are
17
17
  implemented. Use the skill shipped with the selected executable or
18
- the same source revision. If an older installation exposes a different
18
+ the same source revision. If the selected installation exposes a different
19
19
  interface, report the mismatch and use its matching guidance; do not silently
20
- change the version pin or substitute removed commands.
20
+ change the version pin or substitute unsupported commands.
21
21
 
22
22
  ## Resolve the CLI fallback
23
23
 
@@ -52,7 +52,9 @@ the MCP server was started with that root bound by `--project`. Use the default
52
52
  `minimal` template unless the user explicitly requests `empty` or `engineering`.
53
53
  Pass the selected name as `template` to `project_init`.
54
54
  `engineering` includes engineering flavours, selection guidance, and traceability
55
- relations; all templates generate configuration and schema only. The CLI equivalent
55
+ relations. It also installs enabled `.mara/engineering-rules.yaml` and request-local
56
+ `.mara/engineering-checks.yaml` and `.mara/engineering-execution.yaml`; no starter
57
+ items are generated. The CLI equivalent
56
58
  is `"${mara_cli[@]}" --project /absolute/project --format json project init --template <template>`,
57
59
  where `<template>` is the selected `minimal`, `empty`, or `engineering` name.
58
60
  Do not create or modify `AGENTS.md` as part of Mara onboarding.
@@ -74,27 +76,44 @@ Use the selected project's declarations, including custom flavours. Keep
74
76
  supporting narrative as Markdown when it does not need an independent identity;
75
77
  search/get/related can still discover, read, and navigate it.
76
78
 
77
- Schema format 3 retains all four guidance keys directly on every flavour:
79
+ Schema format 3 requires all four guidance keys directly on every flavour:
78
80
  a nonblank `description`, a nonempty list of nonblank `use_when` entries,
79
81
  an `avoid_when` list (`[]` is valid), and a `distinguish_from` mapping (`{}` is
80
82
  valid). Distinction targets must be other declared flavours with nonblank
81
- explanations. When asked to migrate format 1, edit the existing schema in place,
82
- set `format_version: 3`, and supply meaningful guidance. Preserve custom
83
- flavours, prefixes, fields, relations, document bytes, IDs, and MIDs; do not
83
+ explanations. Edit the project schema in place with `format_version: 3` and
84
+ meaningful guidance. Preserve custom flavours, prefixes, fields, relations,
85
+ document bytes, IDs, and MIDs; do not
84
86
  reinitialize or replace the schema with a template. Require `valid:true` from
85
87
  both `schema_validate` and `project_validate` (CLI `schema validate` and
86
88
  `project validate`).
87
89
 
88
90
  For the engineering template, inspect `schema_get` relation declarations before
89
91
  connecting items. `verification` describes a repeatable check; `evidence`
90
- records its result. The added relations are `verifies` (verification →
92
+ records its result. Engineering relations are `verifies` (verification →
91
93
  requirement/design), `validates` (verification → goal/scenario), `evidences`
92
- (evidence → verification), `implements` (artifact → requirement/design),
94
+ (evidence → verification), `realizes` (artifact → requirement/design), code `implements`
95
+ (→ requirement/design/verification) and code `checks` (→ requirement/design),
93
96
  `affects` (risk → affected knowledge), and `mitigates`
94
97
  (requirement/design/decision/verification → risk). Add only meaningful links;
95
98
  no complete trace chain or placeholder items are required. Existing projects
96
99
  do not gain these declarations automatically.
97
100
 
101
+ New engineering items require `status`. Use `draft` while classifications and
102
+ links are incomplete; `accepted` enables the bundled knowledge policies, and
103
+ `retired` excludes an item from accepted coverage. Requirements
104
+ and designs need `kind` when accepted; verification needs `method`, evidence needs
105
+ `result`, `captured_at` and `subject_revision`, and risk needs `treatment`. Inspect
106
+ the schema for enum values and optional fields. A status of accepted does not
107
+ claim implementation or passing tests.
108
+
109
+ Use `.mara/engineering-checks.yaml` with shape IRIs `urn:mara:rule:intent`,
110
+ `urn:mara:rule:realization`, `urn:mara:rule:verification` or
111
+ `urn:mara:rule:validation` on appropriate accepted roots. For execution, use
112
+ `.mara/engineering-execution.yaml` with `urn:mara:rule:execution` on accepted
113
+ verifications and bind `subject_revision` to the actual tested identity. This
114
+ requires accepted evidence with `result: passed` at that revision; historical
115
+ passing evidence and code associations do not establish a current execution result.
116
+
98
117
  ## Choose the operation
99
118
 
100
119
  CLI entries below follow `"${mara_cli[@]}" --project /absolute/project --format json`;
@@ -123,11 +142,11 @@ Warnings do not invalidate a complete result; configuration/source failures
123
142
  remain errors. Current-state rules load from explicit YAML files enabled by
124
143
  project format 2 and `[rules]` with `format_version = 1` and `files = [...]`.
125
144
  Run `schema_validate` to check definitions, then `project_validate` or
126
- `item_validate` to evaluate policy. Status/owner fields are project-defined;
127
- templates and existing projects gain no policies automatically. Schema relation
128
- `cardinality` and `acyclic` declarations impose structural graph policies when
145
+ `item_validate` to evaluate policy. Status/owner fields are project-defined.
146
+ The engineering template supplies `status: draft|accepted|retired` and accepted-knowledge policies; existing
147
+ projects gain no policies automatically. Schema relation `cardinality` and `acyclic` declarations impose structural graph policies when
129
148
  present. Policy failures do not block structured edits.
130
- Invalid schemas now return the common envelope with `valid:false`, not an MCP
149
+ Invalid schemas return the common envelope with `valid:false`, not an MCP
131
150
  tool error. Counts are null when the schema cannot load. Diagnostic `path` and
132
151
  `line` alias `location`; project-owned configuration paths are relative and
133
152
  unavailable coordinates are omitted.
@@ -197,7 +216,7 @@ different connections to the same neighbour. The byte budget may shorten pages.
197
216
 
198
217
  Unified discovery responses use `format_version: 2`, independently of schema
199
218
  format 3 and the application version. Inspect `node.kind` (item, section, block,
200
- or document); only items have ID/MID/flavour. Item list retains its item-only
219
+ document, or code); only items have ID/MID/flavour. Item list retains its item-only
201
220
  response. On upgrade, discard old cursors and update parsers for the mixed
202
221
  `results`, consecutive `content`, and `connections` shapes above.
203
222
 
@@ -207,6 +226,59 @@ then `"${mara_cli[@]}" --project /absolute/project --format json get '<reference
207
226
  Use `related '<reference>'` for connections, `--relation builtin:mentions` to
208
227
  select explicit mentions, and `--cursor '<next_cursor>'` for continuation.
209
228
 
229
+ ## Code endpoints
230
+
231
+ Project format 3 uses one `[[code.languages]]` entry per integration with
232
+ `name`, nonempty `extensions`, and `command` (executable/arguments, one standalone
233
+ `{output}` placeholder). Extensions are case-sensitive suffixes without dots,
234
+ unique across language entries. Mara invokes an indexer automatically from the
235
+ project root only when unignored source files match its extensions. With no
236
+ matches it skips that indexer, so empty projects can use documentation operations.
237
+ Adding the first matching file activates indexing; removing the last skips it again.
238
+ This applies with or without Tree-sitter and never suppresses failures once source
239
+ files exist. Configuration and any declared grammar assets must still be valid;
240
+ install indexers separately and only configure trusted commands. Commands may
241
+ run build tools. Missing executables or invalid output fail the operation.
242
+ Optional `position_encoding` supplies `utf8`, `utf16` or `utf32` for old indexers
243
+ that omit their document encoding. The same entry may include `grammar` and
244
+ `query` together for runtime Tree-sitter assets that attach comments
245
+ and expand declaration content. Without these assets, symbol links still work;
246
+ content uses the SCIP enclosing range, or the definition token when absent.
247
+ Language integrations are supplied by the project.
248
+
249
+ For example, with `rust-analyzer` installed and matching grammar assets present:
250
+
251
+ ```toml
252
+ [[code.languages]]
253
+ name = "rust"
254
+ command = ["rust-analyzer", "scip", ".", "--output", "{output}"]
255
+ position_encoding = "utf8"
256
+ extensions = ["rs"]
257
+ grammar = ".mara/code/rust.wasm"
258
+ query = ".mara/code/rust.scm"
259
+ ```
260
+
261
+ Omit `grammar` and `query` for SCIP-only use; keep `extensions`. Commands and paths are
262
+ project-owned; Mara supplies no per-language defaults.
263
+
264
+ Source markers use `@mara <canonical-relation> <item-ID-or-MID>` within captured
265
+ comments. All markers in a leading comment group attach to the following
266
+ supported declaration through its modifier/wrapper boundary. Ordinary/doc
267
+ comments and blank lines may intervene; statements and lexical body boundaries
268
+ stop attachment. Original marker spans and declaration content remain separate.
269
+ Otherwise retain deepest-enclosing ownership, valid file fallback, or an
270
+ unsupported/ambiguous-owner diagnostic. Inspect exact endpoints with `related`
271
+ and `relation get`: validation alone also accepts unintended file links.
272
+
273
+ Use exact `code:path::language::descriptor` references returned by navigation.
274
+ Descriptors omit SCIP package metadata so version bumps preserve local links.
275
+ Unsafe inline characters use uppercase UTF-8 percent escapes. Backticks remain
276
+ literal: `` code:service.ts::typescript::`service.ts`/parse(). ``. Local SCIP symbols are
277
+ unsupported. Distinct implementation overloads require distinct indexer identities;
278
+ multiple declarations of one identity share a link. No name/position fallback is
279
+ allowed. Renames/moves may break authored links. File-only `code:path` needs no
280
+ language integration. See `docs/code-traceability.mara.md` in the Mara repository.
281
+
210
282
  ## Inspect and change relationships
211
283
 
212
284
  Schema lookup accepts inverse aliases and returns the canonical declaration,
@@ -248,34 +320,70 @@ tokens outside item bodies have no typed meaning. Unknown relations, malformed
248
320
  tokens and invalid targets in supported contexts fail validation. Use body
249
321
  creation/update to author inline assertions; relation add writes metadata.
250
322
 
251
- For a format-1/2 or relation-vocabulary migration, follow
252
- `docs/migration-0.3.mara.md` with the matching 0.3 executable. The supported
253
- workflow is manual: save a Git checkpoint or project copy, review the complete
254
- source diff, then require complete, valid schema and project validation. Mara
255
- has no schema migration preview/apply command; `project_transaction_rollback`
256
- does not undo manual edits. Preserve MIDs and unrelated declarations, fields,
257
- prose and links. Existing relations remain directed with no alias unless the
258
- schema explicitly changes. Review newly meaningful typed tokens, alias
259
- collisions, all authored spellings and YAML rule paths before changing names.
260
- When removing an inverse alias, inspect the canonical edge, reauthor it on its
261
- canonical source if needed, remove inverse metadata, and demote inverse inline
262
- tokens to bare mentions when preserving prose navigation. Never replace an
263
- inverse name with the canonical name on the same item: that can reverse a
264
- directed edge while validation still passes. Verify the canonical endpoints
265
- after migration. Do not treat a direction, endpoint or meaning change as a
266
- rename.
323
+ Before manually changing schema or relation vocabulary, read the source-edit
324
+ workflow in `docs/schema-evolution.mara.md` in the Mara repository. Use the
325
+ selected executable to inspect declarations and canonical edge occurrences,
326
+ then run complete schema/project validation and consume all pages. Preserve a
327
+ source checkpoint for manual recovery; `project_transaction_rollback` handles
328
+ only a pending structured mutation journal.
267
329
 
268
330
  ## Inspect trace coverage
269
331
 
270
332
  Use `trace_matrix` (CLI `trace matrix`) for a read-only view of selected roots.
271
333
  Select roots with `ids`, `flavours`, `fields`, `paths`, or `all:true`; pass either
272
- enabled rule IRIs in `rules` or a request-local `check:{files,shape}`. CLI uses
334
+ enabled rule IRIs in `rules` or a request-local `check:{files,shape,parameters?}`. CLI uses
273
335
  repeatable `--id`, `--flavour`, `--field KEY=VALUE`, `--path`, and either
274
336
  `--rule` or `--check-file` with `--shape`. Do not mix the two evaluation modes.
275
337
  The check files supply shapes for this request only; they do not enable policy
276
338
  for project validation. A named rule uses its own applicability and selection
277
339
  within the requested roots.
278
340
 
341
+ For a reusable revision check, use a targetless root and an evidence shape in
342
+ `rules/revision.yaml` (assuming the project declares these relations, flavours
343
+ and evidence fields):
344
+
345
+ ```yaml
346
+ - id: rule:revision_evidence
347
+ class: requirement
348
+ property:
349
+ - path: status
350
+ hasValue: accepted
351
+ - path: {inversePath: verifies}
352
+ qualifiedValueShape: rule:verified_revision
353
+ qualifiedMinCount: 1
354
+ - id: rule:verified_revision
355
+ class: verification
356
+ property:
357
+ - path: status
358
+ hasValue: accepted
359
+ - path: {inversePath: evidences}
360
+ qualifiedValueShape: rule:passing_revision
361
+ qualifiedMinCount: 1
362
+ - id: rule:passing_revision
363
+ class: evidence
364
+ property:
365
+ - path: status
366
+ hasValue: accepted
367
+ - path: result
368
+ hasValue: passed
369
+ - path: subject_revision
370
+ hasValue: {parameter: subject_revision}
371
+ ```
372
+
373
+ Pass the concrete revision through CLI or MCP:
374
+
375
+ ```text
376
+ mara trace matrix --id REQ-A --check-file rules/revision.yaml --shape urn:mara:rule:revision_evidence --param subject_revision=abc123
377
+ trace_matrix {ids:["REQ-A"],check:{files:["rules/revision.yaml"],shape:"urn:mara:rule:revision_evidence",parameters:{subject_revision:"abc123"}}}
378
+ ```
379
+
380
+ A placeholder may also be an entry in `in`.
381
+ Values are exact text literals, including empty text; resolve Git refs before
382
+ calling Mara. Missing, invalid, duplicate CLI, and unused bindings are errors.
383
+ Keep the YAML unchanged across revisions. Read the resulting state and resolved
384
+ literal in check explanations; this selects recorded evidence and neither runs
385
+ a test nor proves its authenticity. Parameters do not apply to enabled rules.
386
+
279
387
  Read each result state (`passed`, `failed`, `not_applicable`, `unavailable`),
280
388
  the check and edge records, source locations, and per-evaluation `summaries`.
281
389
  An external endpoint is terminal; an edge outside root selection can still
@@ -1,60 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- "use strict";
4
-
5
- const path = require("node:path");
6
- const { spawn } = require("node:child_process");
7
-
8
- const packages = new Map([
9
- ["linux:x64", "@convesoft/mara-linux-x64-gnu"],
10
- ["linux:arm64", "@convesoft/mara-linux-arm64-gnu"],
11
- ["darwin:x64", "@convesoft/mara-darwin-x64"],
12
- ["darwin:arm64", "@convesoft/mara-darwin-arm64"],
13
- ]);
14
-
15
- const manifest = require("../package.json");
16
- const packageName = packages.get(`${process.platform}:${process.arch}`);
17
- let hasLocalRuntime = false;
18
-
19
- if (packageName !== undefined) {
20
- try {
21
- require.resolve(`${packageName}/package.json`);
22
- hasLocalRuntime = true;
23
- } catch {
24
- // Codex extracts npm plugin packages without installing their dependencies.
25
- }
26
- }
27
-
28
- const command = hasLocalRuntime ? process.execPath : "npx";
29
- const args = hasLocalRuntime
30
- ? [path.join(__dirname, "mara.cjs"), ...process.argv.slice(2)]
31
- : ["--yes", `${manifest.name}@${manifest.version}`, ...process.argv.slice(2)];
32
- const child = spawn(command, args, {
33
- cwd: hasLocalRuntime ? undefined : path.parse(__dirname).root,
34
- stdio: "inherit",
35
- });
36
- const signals = ["SIGINT", "SIGTERM", "SIGHUP"];
37
- const forward = new Map();
38
-
39
- for (const signal of signals) {
40
- const handler = () => child.kill(signal);
41
- forward.set(signal, handler);
42
- process.on(signal, handler);
43
- }
44
-
45
- child.once("error", (error) => {
46
- console.error(`Could not start Mara from the Agent Plugin: ${error.message}`);
47
- process.exitCode = 1;
48
- });
49
-
50
- child.once("exit", (code, signal) => {
51
- for (const [name, handler] of forward) {
52
- process.off(name, handler);
53
- }
54
-
55
- if (signal !== null) {
56
- process.kill(process.pid, signal);
57
- } else {
58
- process.exitCode = code ?? 1;
59
- }
60
- });
package/mcp.json DELETED
@@ -1,10 +0,0 @@
1
- {
2
- "$schema": "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json",
3
- "mcpServers": {
4
- "mara": {
5
- "type": "stdio",
6
- "command": "node",
7
- "args": ["${PLUGIN_ROOT}/bin/mara-plugin.cjs", "mcp"]
8
- }
9
- }
10
- }
package/plugin.json DELETED
@@ -1,19 +0,0 @@
1
- {
2
- "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
3
- "name": "mara",
4
- "description": "Discover, author, relate, and validate structured project knowledge.",
5
- "author": {
6
- "name": "Convesoft",
7
- "url": "https://github.com/convesoft"
8
- },
9
- "homepage": "https://github.com/convesoft/mara",
10
- "repository": "https://github.com/convesoft/mara",
11
- "license": "MIT OR Apache-2.0",
12
- "keywords": [
13
- "project-knowledge",
14
- "requirements",
15
- "mcp",
16
- "agent-skill"
17
- ],
18
- "version": "0.3.0-alpha.0"
19
- }