@convesoft/mara 0.2.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 +35 -136
- package/bin/mara.cjs +1 -2
- package/package.json +4 -8
- package/skills/mara/SKILL.md +239 -17
- package/bin/mara-plugin.cjs +0 -60
- package/mcp.json +0 -10
- package/plugin.json +0 -19
package/README.md
CHANGED
|
@@ -1,169 +1,68 @@
|
|
|
1
1
|
# Mara
|
|
2
2
|
|
|
3
|
-
Mara keeps project knowledge in readable Markdown
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
|
|
9
|
-
selection guidance, an engineering template, and unified `search`, `get`, and
|
|
10
|
-
`related`. Start with the [0.2 migration guide](docs/migration-0.2.mara.md) for
|
|
11
|
-
an existing project. The [0.1.0 documentation](https://github.com/convesoft/mara/tree/v0.1.0)
|
|
12
|
-
describes the older released interface; use documentation and skill from the
|
|
13
|
-
same revision as your executable.
|
|
8
|
+
## Run
|
|
14
9
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
Build the implementation described here with the pinned Rust toolchain:
|
|
10
|
+
Build from this checkout with the pinned Rust toolchain:
|
|
18
11
|
|
|
19
12
|
```bash
|
|
20
13
|
cargo build --locked --release
|
|
21
14
|
./target/release/mara --help
|
|
22
15
|
```
|
|
23
16
|
|
|
24
|
-
|
|
25
|
-
that exposes the same interface. Register its absolute path for MCP. The
|
|
26
|
-
checkout's version string alone does not establish which unreleased changes
|
|
27
|
-
an older published prerelease includes; check its help and matching release
|
|
28
|
-
notes before using the 0.2 workflow.
|
|
29
|
-
|
|
30
|
-
Published npm packages contain prebuilt native binaries and use no install
|
|
31
|
-
scripts or Rust toolchain. Run the stable 0.2.0 version:
|
|
17
|
+
For a published release, replace `<version>` with its exact version:
|
|
32
18
|
|
|
33
19
|
```bash
|
|
34
|
-
npx -y '@convesoft/mara
|
|
35
|
-
npx -y '@convesoft/mara@0.2.0' --help
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
Keep that exact pin in CLI and MCP launchers. Supported hosts are x64 and
|
|
39
|
-
arm64 macOS, plus x64 and arm64 Linux compatible with Ubuntu 22.04's glibc
|
|
40
|
-
baseline. Distribution guarantees are in
|
|
41
|
-
[distribution and release](docs/distribution.mara.md).
|
|
42
|
-
|
|
43
|
-
## Configure an MCP client
|
|
44
|
-
|
|
45
|
-
For a client that starts stdio servers in the project directory:
|
|
46
|
-
|
|
47
|
-
```toml
|
|
48
|
-
[mcp_servers.mara]
|
|
49
|
-
command = "/absolute/path/to/mara"
|
|
50
|
-
args = ["mcp"]
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
To bind the server to one project regardless of its execution directory:
|
|
54
|
-
|
|
55
|
-
```toml
|
|
56
|
-
[mcp_servers.mara]
|
|
57
|
-
command = "/absolute/path/to/mara"
|
|
58
|
-
args = ["mcp", "--project", "/absolute/path/to/project"]
|
|
20
|
+
npx -y '@convesoft/mara@<version>' --help
|
|
59
21
|
```
|
|
60
22
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
A bound server rejects request-level project overrides; omit that parameter.
|
|
66
|
-
|
|
67
|
-
## Configure Codex
|
|
68
|
-
|
|
69
|
-
Register the executable and install [the Mara skill](skills/mara/SKILL.md)
|
|
70
|
-
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).
|
|
71
27
|
|
|
72
|
-
|
|
73
|
-
codex mcp add mara -- /absolute/path/to/mara mcp
|
|
74
|
-
```
|
|
28
|
+
## Configure an agent
|
|
75
29
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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.
|
|
81
35
|
|
|
82
|
-
|
|
83
|
-
|
|
36
|
+
Install the standalone skill separately from the matching checkout or extracted
|
|
37
|
+
npm package:
|
|
84
38
|
|
|
85
39
|
```bash
|
|
86
|
-
|
|
87
|
-
codex plugin add mara@convesoft
|
|
40
|
+
npx skills add /absolute/path/to/mara-package --skill mara
|
|
88
41
|
```
|
|
89
42
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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.
|
|
93
47
|
|
|
94
|
-
##
|
|
48
|
+
## Author knowledge
|
|
95
49
|
|
|
96
|
-
|
|
97
|
-
first item operation:
|
|
50
|
+
In a new project directory, using `mara` for the selected executable:
|
|
98
51
|
|
|
99
52
|
```bash
|
|
100
53
|
mara project init --template engineering
|
|
101
|
-
mara schema list flavour
|
|
102
54
|
mara schema get flavour requirement
|
|
103
|
-
mara schema get relation verifies
|
|
104
55
|
mara item create requirement REQ-ACCESS knowledge.mara.md \
|
|
105
|
-
--title
|
|
106
|
-
|
|
107
|
-
--title "Check access" \
|
|
108
|
-
--body "Demonstrate that an authorized user can access the service." \
|
|
109
|
-
--relation verifies=REQ-ACCESS
|
|
56
|
+
--title 'Permit access' --body 'An authorized user can access the service.' \
|
|
57
|
+
--field status=draft
|
|
110
58
|
mara project validate
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
`minimal` remains the default template; `empty` declares no vocabulary.
|
|
114
|
-
`engineering` supplies engineering flavours and traceability relations.
|
|
115
|
-
Templates create configuration and an editable schema only. Before creating an
|
|
116
|
-
item, use the flavour's `description`, `use_when`, `avoid_when`, and
|
|
117
|
-
`distinguish_from` to choose appropriate knowledge, then inspect its ID prefix,
|
|
118
|
-
body, and field constraints. These guidance keys belong to the schema, not
|
|
119
|
-
item metadata. See [guided authoring](docs/guided-authoring.mara.md) for the
|
|
120
|
-
schema contract and engineering relation meanings.
|
|
121
|
-
|
|
122
|
-
## Discovery and reading
|
|
123
|
-
|
|
124
|
-
```bash
|
|
125
|
-
mara --format json search "authorized user"
|
|
59
|
+
mara --format json search 'authorized user'
|
|
126
60
|
mara --format json get REQ-ACCESS
|
|
127
|
-
mara --format json related REQ-ACCESS --direction incoming --relation verifies
|
|
128
|
-
mara --format json get VER-ACCESS
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
CLI and MCP use `search`, `get`, and `related`; MCP get/related take
|
|
132
|
-
`{"reference":"REQ-ACCESS"}`. Search returns mixed item, section, and Markdown
|
|
133
|
-
block hits with one excerpt each. Pass a hit's `node.reference` to get or
|
|
134
|
-
related, then read selected `connections[].neighbour.reference` values.
|
|
135
|
-
`node.context.parent` identifies direct structural context. Documents and
|
|
136
|
-
sections can be read and navigated without client filesystem access.
|
|
137
|
-
|
|
138
|
-
Repeat a paginated call with its `next_cursor` until `has_more:false`, keeping
|
|
139
|
-
all other inputs unchanged. Get returns consecutive content and ordered item
|
|
140
|
-
metadata fragments; search excerpts are only for selection. Search and related
|
|
141
|
-
accept `limit`; get does not. Item filters exclude narrative; project-relative
|
|
142
|
-
path filters cover all search result kinds. For response fields, relation
|
|
143
|
-
namespaces, containment, and handle lifetime, see
|
|
144
|
-
[the discovery contract](docs/discovery.mara.md).
|
|
145
|
-
|
|
146
|
-
Item authoring, list, and validation remain under `item`; relation mutations
|
|
147
|
-
write schema-defined item edges. Mentions and containment derive from Markdown.
|
|
148
|
-
Editing rejects changes that break or retarget surviving internal links; resolve
|
|
149
|
-
reported impacts before retrying. See [item editing](docs/editing.mara.md) and
|
|
150
|
-
[Markdown links and mutation safety](docs/discovery.mara.md#item-mutation-and-link-safety).
|
|
151
|
-
Use `mara --help` or `mara <command> --help` for command and argument guidance.
|
|
152
|
-
|
|
153
|
-
## Development
|
|
154
|
-
|
|
155
|
-
```bash
|
|
156
|
-
cargo fmt --all -- --check
|
|
157
|
-
cargo clippy --locked --all-targets --all-features -- -D warnings
|
|
158
|
-
cargo test --locked --all-targets
|
|
159
|
-
cargo run --locked --quiet -- --format json project validate
|
|
160
|
-
scripts/smoke-npm.sh target/release/mara
|
|
161
61
|
```
|
|
162
62
|
|
|
163
|
-
|
|
164
|
-
[
|
|
165
|
-
|
|
166
|
-
|
|
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.
|
|
167
67
|
|
|
168
|
-
Licensed under
|
|
169
|
-
[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
|
|
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
|
+
"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.
|
|
22
|
-
"@convesoft/mara-linux-arm64-gnu": "0.
|
|
23
|
-
"@convesoft/mara-darwin-
|
|
24
|
-
"@convesoft/mara-darwin-arm64": "0.2.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",
|
package/skills/mara/SKILL.md
CHANGED
|
@@ -10,11 +10,14 @@ When MCP is unavailable, use an available Mara CLI invocation with `--format jso
|
|
|
10
10
|
for structured results. The same operation selection, authoring, continuation,
|
|
11
11
|
and validation rules apply to both surfaces.
|
|
12
12
|
|
|
13
|
-
This skill targets the 0.
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
This skill targets the current 0.3 development interface: schema format 3,
|
|
14
|
+
discovery format 2, relationship format 1, validation format 1, and trace
|
|
15
|
+
format 1. Typed inline relationships, inverse aliases, symmetric edges,
|
|
16
|
+
external targets, graph policies, YAML current-state rules, and matrices are
|
|
17
|
+
implemented. Use the skill shipped with the selected executable or
|
|
18
|
+
the same source revision. If the selected installation exposes a different
|
|
16
19
|
interface, report the mismatch and use its matching guidance; do not silently
|
|
17
|
-
change the version pin or substitute
|
|
20
|
+
change the version pin or substitute unsupported commands.
|
|
18
21
|
|
|
19
22
|
## Resolve the CLI fallback
|
|
20
23
|
|
|
@@ -49,7 +52,9 @@ the MCP server was started with that root bound by `--project`. Use the default
|
|
|
49
52
|
`minimal` template unless the user explicitly requests `empty` or `engineering`.
|
|
50
53
|
Pass the selected name as `template` to `project_init`.
|
|
51
54
|
`engineering` includes engineering flavours, selection guidance, and traceability
|
|
52
|
-
relations
|
|
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
|
|
53
58
|
is `"${mara_cli[@]}" --project /absolute/project --format json project init --template <template>`,
|
|
54
59
|
where `<template>` is the selected `minimal`, `empty`, or `engineering` name.
|
|
55
60
|
Do not create or modify `AGENTS.md` as part of Mara onboarding.
|
|
@@ -71,27 +76,44 @@ Use the selected project's declarations, including custom flavours. Keep
|
|
|
71
76
|
supporting narrative as Markdown when it does not need an independent identity;
|
|
72
77
|
search/get/related can still discover, read, and navigate it.
|
|
73
78
|
|
|
74
|
-
Schema format
|
|
79
|
+
Schema format 3 requires all four guidance keys directly on every flavour:
|
|
75
80
|
a nonblank `description`, a nonempty list of nonblank `use_when` entries,
|
|
76
81
|
an `avoid_when` list (`[]` is valid), and a `distinguish_from` mapping (`{}` is
|
|
77
82
|
valid). Distinction targets must be other declared flavours with nonblank
|
|
78
|
-
explanations.
|
|
79
|
-
|
|
80
|
-
|
|
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
|
|
81
86
|
reinitialize or replace the schema with a template. Require `valid:true` from
|
|
82
87
|
both `schema_validate` and `project_validate` (CLI `schema validate` and
|
|
83
88
|
`project validate`).
|
|
84
89
|
|
|
85
90
|
For the engineering template, inspect `schema_get` relation declarations before
|
|
86
91
|
connecting items. `verification` describes a repeatable check; `evidence`
|
|
87
|
-
records its result.
|
|
92
|
+
records its result. Engineering relations are `verifies` (verification →
|
|
88
93
|
requirement/design), `validates` (verification → goal/scenario), `evidences`
|
|
89
|
-
(evidence → verification), `
|
|
94
|
+
(evidence → verification), `realizes` (artifact → requirement/design), code `implements`
|
|
95
|
+
(→ requirement/design/verification) and code `checks` (→ requirement/design),
|
|
90
96
|
`affects` (risk → affected knowledge), and `mitigates`
|
|
91
97
|
(requirement/design/decision/verification → risk). Add only meaningful links;
|
|
92
98
|
no complete trace chain or placeholder items are required. Existing projects
|
|
93
99
|
do not gain these declarations automatically.
|
|
94
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
|
+
|
|
95
117
|
## Choose the operation
|
|
96
118
|
|
|
97
119
|
CLI entries below follow `"${mara_cli[@]}" --project /absolute/project --format json`;
|
|
@@ -107,9 +129,39 @@ inspect `<command> --help` for positional arguments and options.
|
|
|
107
129
|
| Change title, custom fields, or body | `item_update` | `item update` |
|
|
108
130
|
| Relocate an item; preserve ID and MID | `item_move` | `item move` |
|
|
109
131
|
| Change human ID and supported references; preserve MID | `item_rename` | `item rename` |
|
|
132
|
+
| Inspect an edge and its source occurrences | `relation_get` | `relation get SOURCE RELATION TARGET` |
|
|
110
133
|
| Add or remove an existing item's typed edge | `relation_add` or `relation_remove` | `relation add`, `relation remove` |
|
|
111
134
|
| Delete an item; resolve reported relation/mention blockers | `item_delete` | `item delete` |
|
|
112
135
|
| Check an item or whole-project integrity | `item_validate` or `project_validate` | `item validate`, `project validate` |
|
|
136
|
+
| Inspect coverage for selected roots | `trace_matrix` | `trace matrix` |
|
|
137
|
+
|
|
138
|
+
Validation (`project_validate`, `item_validate`, `schema_validate`) returns
|
|
139
|
+
`valid`, `evaluation_complete`, `summary`, `diagnostics`, and output
|
|
140
|
+
continuation. Match diagnostic `code` and `severity`, not message text.
|
|
141
|
+
Warnings do not invalidate a complete result; configuration/source failures
|
|
142
|
+
remain errors. Current-state rules load from explicit YAML files enabled by
|
|
143
|
+
project format 2 and `[rules]` with `format_version = 1` and `files = [...]`.
|
|
144
|
+
Run `schema_validate` to check definitions, then `project_validate` or
|
|
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
|
|
148
|
+
present. Policy failures do not block structured edits.
|
|
149
|
+
Invalid schemas return the common envelope with `valid:false`, not an MCP
|
|
150
|
+
tool error. Counts are null when the schema cannot load. Diagnostic `path` and
|
|
151
|
+
`line` alias `location`; project-owned configuration paths are relative and
|
|
152
|
+
unavailable coordinates are omitted.
|
|
153
|
+
|
|
154
|
+
All three validation operations accept `limit` (1–100, default 20) and `cursor`;
|
|
155
|
+
CLI uses `--limit` and `--cursor`.
|
|
156
|
+
Continue unchanged inputs until `has_more:false`; summary
|
|
157
|
+
and validity cover the full target before pagination and reporting paths.
|
|
158
|
+
With configured rules, invalid corpus prerequisites skip policy evaluation,
|
|
159
|
+
including item-targeted checks. Fix the original diagnostics and run validation
|
|
160
|
+
again. `evaluation_unavailable` never means a policy pass. There is no logical
|
|
161
|
+
work counter; finite shape/path restrictions and output pagination remain.
|
|
162
|
+
Invalid arguments, stale cursors,
|
|
163
|
+
I/O preventing a result, and oversized indivisible output return
|
|
164
|
+
`{format_version:1,error:{code,message}}` with MCP `isError:true`.
|
|
113
165
|
|
|
114
166
|
Use mutations only when the user has asked to change project knowledge. Choose
|
|
115
167
|
the structured mutation for the semantic change. An invalid-argument error calls
|
|
@@ -136,11 +188,12 @@ accept `limit`.
|
|
|
136
188
|
|
|
137
189
|
Call `related` with `{"reference":"<selected reference>"}` for direct schema
|
|
138
190
|
relations, mentions, and containment. It returns `node` and
|
|
139
|
-
`connections
|
|
191
|
+
`connections`; pass a selected
|
|
140
192
|
`neighbour.reference` to `get` or another `related` call. Each call follows only
|
|
141
193
|
direct connections; there is no automatic expansion or hops option.
|
|
142
194
|
|
|
143
|
-
Use `direction:"incoming"` or `"
|
|
195
|
+
Use `direction:"incoming"`, `"outgoing"`, or `"symmetric"`; omission includes all.
|
|
196
|
+
Direction is canonical even when a relation filter uses an inverse alias. Related
|
|
144
197
|
`relations` accepts `schema:name` and `builtin:name`, with short names allowed
|
|
145
198
|
only when unambiguous in the vocabulary. Related `flavours` selects item
|
|
146
199
|
neighbours only. JSON represents containment as `contains` with direction;
|
|
@@ -161,9 +214,9 @@ Item MIDs retain durable identity. Search and related default to 20 entries
|
|
|
161
214
|
and accept `limit` from 1 through 100; related counts connections, including
|
|
162
215
|
different connections to the same neighbour. The byte budget may shorten pages.
|
|
163
216
|
|
|
164
|
-
Unified discovery responses use `format_version:
|
|
165
|
-
format
|
|
166
|
-
or
|
|
217
|
+
Unified discovery responses use `format_version: 2`, independently of schema
|
|
218
|
+
format 3 and the application version. Inspect `node.kind` (item, section, block,
|
|
219
|
+
document, or code); only items have ID/MID/flavour. Item list retains its item-only
|
|
167
220
|
response. On upgrade, discard old cursors and update parsers for the mixed
|
|
168
221
|
`results`, consecutive `content`, and `connections` shapes above.
|
|
169
222
|
|
|
@@ -173,6 +226,175 @@ then `"${mara_cli[@]}" --project /absolute/project --format json get '<reference
|
|
|
173
226
|
Use `related '<reference>'` for connections, `--relation builtin:mentions` to
|
|
174
227
|
select explicit mentions, and `--cursor '<next_cursor>'` for continuation.
|
|
175
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
|
+
|
|
282
|
+
## Inspect and change relationships
|
|
283
|
+
|
|
284
|
+
Schema lookup accepts inverse aliases and returns the canonical declaration,
|
|
285
|
+
`requested_name` and `inverse`. Lists show canonical names with aliases and
|
|
286
|
+
symmetry. Alias endpoint validation exchanges source and target first.
|
|
287
|
+
|
|
288
|
+
`related` returns each semantic schema edge once, with canonical `relation`,
|
|
289
|
+
endpoint-facing `label`, `direction`, `neighbour`, `edge` and `occurrence_count`.
|
|
290
|
+
Builtin connections retain `source`; use `relation_get` for schema locations.
|
|
291
|
+
Symmetric edges are excluded by incoming/outgoing filters. Directed self-edges
|
|
292
|
+
appear once as outgoing when direction is omitted. Different relation kinds
|
|
293
|
+
remain distinct. Item-list/search filters still select items with authored
|
|
294
|
+
metadata or inline assertions; canonical and alias filters select the same kind.
|
|
295
|
+
|
|
296
|
+
`relation_get {source,relation,target,limit?,cursor?}` returns the canonical
|
|
297
|
+
`edge`, total `occurrence_count` and a page of `occurrences`. Each occurrence
|
|
298
|
+
retains its author, spelling, source location and opaque `reference` selector.
|
|
299
|
+
Default limit is 20, maximum 100, with a 65,536-byte budget. Continue unchanged
|
|
300
|
+
until `has_more:false`; re-inspect after source/schema changes.
|
|
301
|
+
|
|
302
|
+
Add rejects an edge already asserted anywhere, including inverse, symmetric
|
|
303
|
+
and inline ID/MID equivalents. Direct source may intentionally repeat assertions.
|
|
304
|
+
`relation_remove {source,relation,target}` removes every occurrence across
|
|
305
|
+
included files. Supply `occurrence` from inspection to remove exactly one.
|
|
306
|
+
Stale or mismatched selectors fail without writes. Results report
|
|
307
|
+
`changed_occurrences`, `remaining_occurrences` and `edge_exists`. Inline removal
|
|
308
|
+
demotes internal `[[relation:target]]` to `[[target]]` and external assertions
|
|
309
|
+
to Markdown autolinks, preserving surrounding prose. The retained internal
|
|
310
|
+
mention still blocks deletion of its target.
|
|
311
|
+
|
|
312
|
+
Author `[[relation:ID]]`, `[[relation:MID]]`, or
|
|
313
|
+
`[[relation:external:https://host/path]]` in an item body using a canonical
|
|
314
|
+
schema name or inverse alias. External targets require `external: true` on the
|
|
315
|
+
relation declaration; Mara preserves their authored address and never fetches it.
|
|
316
|
+
No whitespace, labels or nested markup is allowed
|
|
317
|
+
inside the token. These assertions share metadata edge identity and produce no
|
|
318
|
+
builtin mention. Code, raw contexts and escaped openings remain literal; typed
|
|
319
|
+
tokens outside item bodies have no typed meaning. Unknown relations, malformed
|
|
320
|
+
tokens and invalid targets in supported contexts fail validation. Use body
|
|
321
|
+
creation/update to author inline assertions; relation add writes metadata.
|
|
322
|
+
|
|
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.
|
|
329
|
+
|
|
330
|
+
## Inspect trace coverage
|
|
331
|
+
|
|
332
|
+
Use `trace_matrix` (CLI `trace matrix`) for a read-only view of selected roots.
|
|
333
|
+
Select roots with `ids`, `flavours`, `fields`, `paths`, or `all:true`; pass either
|
|
334
|
+
enabled rule IRIs in `rules` or a request-local `check:{files,shape,parameters?}`. CLI uses
|
|
335
|
+
repeatable `--id`, `--flavour`, `--field KEY=VALUE`, `--path`, and either
|
|
336
|
+
`--rule` or `--check-file` with `--shape`. Do not mix the two evaluation modes.
|
|
337
|
+
The check files supply shapes for this request only; they do not enable policy
|
|
338
|
+
for project validation. A named rule uses its own applicability and selection
|
|
339
|
+
within the requested roots.
|
|
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
|
+
|
|
387
|
+
Read each result state (`passed`, `failed`, `not_applicable`, `unavailable`),
|
|
388
|
+
the check and edge records, source locations, and per-evaluation `summaries`.
|
|
389
|
+
An external endpoint is terminal; an edge outside root selection can still
|
|
390
|
+
contribute to a check. Known rule failures are matrix data, while
|
|
391
|
+
`evaluation_complete:false` means the view could not be fully evaluated.
|
|
392
|
+
Continue with unchanged inputs and `next_cursor` until `has_more:false`;
|
|
393
|
+
restart after source, schema, or rule changes. CLI defaults to Markdown for
|
|
394
|
+
this command; `--format json` returns trace format 1. MCP returns JSON and
|
|
395
|
+
accepts `render:"markdown"` for the matching Markdown page. The output is a
|
|
396
|
+
projection, not a saved source of project knowledge.
|
|
397
|
+
|
|
176
398
|
## Preserve authored references
|
|
177
399
|
|
|
178
400
|
Use `[[ID]]`/`[[MID]]` in item bodies or narrative for item mentions, and
|
|
@@ -204,7 +426,7 @@ The shared `:key: value` source syntax does not make these interchangeable:
|
|
|
204
426
|
- **Typed relations:** `justifies` and `satisfies` are relations, not custom
|
|
205
427
|
fields. `fields:[{"key":"justifies","value":"REQ-EXAMPLE"}]` is invalid.
|
|
206
428
|
Use creation `relations` or explicit relation operations; inspect allowed
|
|
207
|
-
source/target flavours first.
|
|
429
|
+
source/target flavours first. Use canonical names or declared inverse aliases; reverse navigation is derived.
|
|
208
430
|
|
|
209
431
|
CLI equivalents are `--title`, repeatable `--field KEY=VALUE`, update
|
|
210
432
|
`--clear-field KEY`, and creation `--relation NAME=TARGET`. Never pass a relation
|
package/bin/mara-plugin.cjs
DELETED
|
@@ -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
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.2.0"
|
|
19
|
-
}
|