@convesoft/mara 0.1.0-alpha.2 → 0.1.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
@@ -5,7 +5,7 @@ designs, decisions, and other durable facts stable identities, types, relations,
5
5
  validation, and deterministic retrieval. The same operations are available as
6
6
  a CLI and a stdio MCP server.
7
7
 
8
- Mara is currently pre-release software. The supported alpha hosts are x64 and
8
+ Mara 0.1.0 provides the single-project CLI and MCP workflow. Supported hosts are x64 and
9
9
  arm64 macOS, plus x64 and arm64 Linux compatible with Ubuntu 22.04's glibc
10
10
  baseline.
11
11
 
@@ -14,9 +14,9 @@ baseline.
14
14
  Pin the exact version so an MCP restart cannot silently change behavior:
15
15
 
16
16
  ```bash
17
- npx -y @convesoft/mara@0.1.0-alpha.2 --version
18
- npx -y @convesoft/mara@0.1.0-alpha.2 project init ./example
19
- npx -y @convesoft/mara@0.1.0-alpha.2 --project ./example project validate
17
+ npx -y @convesoft/mara@0.1.0 --version
18
+ npx -y @convesoft/mara@0.1.0 project init ./example
19
+ npx -y @convesoft/mara@0.1.0 --project ./example project validate
20
20
  ```
21
21
 
22
22
  The npm packages contain prebuilt native binaries and use no install scripts.
@@ -29,7 +29,7 @@ For a client that starts stdio servers in the project directory:
29
29
  ```toml
30
30
  [mcp_servers.mara]
31
31
  command = "npx"
32
- args = ["-y", "@convesoft/mara@0.1.0-alpha.2", "mcp"]
32
+ args = ["-y", "@convesoft/mara@0.1.0", "mcp"]
33
33
  ```
34
34
 
35
35
  To bind the server to one project regardless of its execution directory, place
@@ -40,7 +40,7 @@ To bind the server to one project regardless of its execution directory, place
40
40
  command = "npx"
41
41
  args = [
42
42
  "-y",
43
- "@convesoft/mara@0.1.0-alpha.2",
43
+ "@convesoft/mara@0.1.0",
44
44
  "mcp",
45
45
  "--project",
46
46
  "/absolute/path/to/project",
@@ -57,7 +57,7 @@ Register the installed Mara executable as an MCP server and install the Mara
57
57
  skill separately:
58
58
 
59
59
  ```bash
60
- codex mcp add mara -- npx -y @convesoft/mara@0.1.0-alpha.2 mcp
60
+ codex mcp add mara -- npx -y @convesoft/mara@0.1.0 mcp
61
61
  npx skills add convesoft/mara --skill mara -g -a codex
62
62
  ```
63
63
 
@@ -97,13 +97,27 @@ mara item get REQ-EXAMPLE
97
97
  ```
98
98
 
99
99
  Run `mara --help` or `mara <object> <operation> --help` for the complete command
100
- surface. The canonical alpha behavior is documented in
100
+ surface. The core behavior is documented in
101
101
  [`docs/alpha.mara.md`](docs/alpha.mara.md). Structured update, move, rename,
102
102
  delete, and recovery follow [`docs/editing.mara.md`](docs/editing.mara.md).
103
+ Search/list, `item related`, and `item get` return bounded pages; repeat the same
104
+ command with `--cursor <next_cursor>` to continue. Get returns consecutive body
105
+ and metadata fragments, then direct relations; follow continuation to retrieve
106
+ the complete item. Inspect selected search passages with
107
+ `mara item search "primary workflow" --id REQ-EXAMPLE --excerpts`.
108
+ Search ranks exact matches before spelling corrections and favours ID/title
109
+ matches. ID/MID field values use exact normalized words; item lookup and filters
110
+ remain exact. Matching, bounds, continuation, and
111
+ excerpts follow
112
+ [`docs/retrieval.mara.md`](docs/retrieval.mara.md).
113
+ Narrative outside item blocks remains accessible through file reads and file
114
+ search; Mara MCP alone does not retrieve it.
103
115
  For existing projects whose items lack machine identities, run
104
116
  `mara project mid backfill`, then `mara project validate` before editing.
105
117
  Distribution and release guarantees are in
106
118
  [`docs/distribution.mara.md`](docs/distribution.mara.md).
119
+ The [stable 0.1 contract](docs/release-0.1.mara.md) records scope and limitations;
120
+ [planned 0.2 changes](docs/guided-authoring.mara.md) are not part of this version.
107
121
 
108
122
  ## Development
109
123
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@convesoft/mara",
3
- "version": "0.1.0-alpha.2",
3
+ "version": "0.1.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,10 +18,10 @@
18
18
  "node": ">=18"
19
19
  },
20
20
  "optionalDependencies": {
21
- "@convesoft/mara-linux-x64-gnu": "0.1.0-alpha.2",
22
- "@convesoft/mara-linux-arm64-gnu": "0.1.0-alpha.2",
23
- "@convesoft/mara-darwin-x64": "0.1.0-alpha.2",
24
- "@convesoft/mara-darwin-arm64": "0.1.0-alpha.2"
21
+ "@convesoft/mara-linux-x64-gnu": "0.1.0",
22
+ "@convesoft/mara-linux-arm64-gnu": "0.1.0",
23
+ "@convesoft/mara-darwin-x64": "0.1.0",
24
+ "@convesoft/mara-darwin-arm64": "0.1.0"
25
25
  },
26
26
  "files": [
27
27
  "bin/mara.cjs",
package/plugin.json CHANGED
@@ -15,5 +15,5 @@
15
15
  "mcp",
16
16
  "agent-skill"
17
17
  ],
18
- "version": "0.1.0-alpha.2"
18
+ "version": "0.1.0"
19
19
  }
@@ -5,8 +5,25 @@ description: Use Mara to initialize, discover, author, relate, retrieve, search,
5
5
 
6
6
  # Mara project knowledge
7
7
 
8
- Use the Mara MCP tools as the structured interface to a project's canonical
9
- `*.mara.md` knowledge.
8
+ Prefer the Mara MCP tools for a project's canonical `*.mara.md` knowledge.
9
+ When MCP is unavailable, use an available Mara CLI invocation with `--format json`
10
+ for structured results. The same operation selection, authoring, continuation,
11
+ and validation rules apply to both surfaces.
12
+
13
+ ## Resolve the CLI fallback
14
+
15
+ Installing the skill does not install `mara` on PATH. Reuse the configured MCP
16
+ launcher: keep its executable, runner arguments, exact package version, and
17
+ environment; replace the `mcp` operation with the required CLI operation. Carry
18
+ any bound project into the CLI's `--project` option.
19
+
20
+ For the Bash examples below, put that launcher in an argument array `mara_cli`:
21
+ `mara_cli=(npx -y '@convesoft/mara@<configured-version>')` (replace the placeholder
22
+ with the existing exact pin), or `mara_cli=('/absolute/path/to/mara')` for a direct
23
+ executable. Use `mara_cli=(mara)` only when `command -v mara` resolves it.
24
+ Check `"${mara_cli[@]}" --version` and the operation's `--help`; preserve the pin
25
+ and use only supported options. If no launcher is available, report the missing
26
+ executable or runner rather than assuming a PATH installation or changing versions.
10
27
 
11
28
  ## Select the project
12
29
 
@@ -15,32 +32,155 @@ Use the Mara MCP tools as the structured interface to a project's canonical
15
32
  server was explicitly started with `mara mcp --project PATH`.
16
33
  - If `project` is omitted, Mara discovers the nearest project from the MCP
17
34
  server's execution directory.
35
+ - For CLI calls, use `"${mara_cli[@]}" --project /absolute/project --format json ...`.
36
+ Without `--project`, the CLI discovers from its working directory.
18
37
  - Treat each operation as scoped to one project. Do not infer workspace or
19
38
  cross-project behavior.
20
39
 
21
40
  If the intended root has no `.mara/project.toml` and the user wants to start a
22
41
  Mara project, call `project_init` with the absolute root, or omit `project` when
23
42
  the MCP server was started with that root bound by `--project`. Use the default
24
- `minimal` template unless the user explicitly requests `empty`. Do not create
25
- or modify `AGENTS.md` as part of Mara onboarding.
26
-
27
- ## Work with the corpus
28
-
29
- 1. Call `schema_get` before authoring unfamiliar flavours, fields, or relations.
30
- 2. Use `item_search`, `item_list`, and `item_related` for bounded discovery;
31
- call `item_get` only for selected full items.
32
- 3. Use `item_create`, `item_update`, `item_move`, `item_rename`, `item_delete`,
33
- `relation_add`, and `relation_remove` only when the user has asked to change
34
- project knowledge.
35
- 4. Run the narrowest relevant validation after a mutation and use
36
- `project_validate` when the requested work affects corpus-wide integrity.
37
-
38
- Mara source files remain canonical. Do not treat MCP results as a separate
39
- authoring store. Use `item_update` for partial title, custom-field, or body edits;
40
- use `item_move` to relocate an item while preserving identity. Update warnings
41
- about existing scaffold bodies still count as errors in explicit validation.
42
- Use `item_delete` to remove an item only when no surviving typed relations or
43
- supported wiki mentions refer to it; resolve reported blockers explicitly.
44
- Use `item_rename` to change a human ID and supported internal references while
45
- preserving the MID. Pending transactions block mutations; use
46
- `project_transaction_rollback` for explicit recovery after stopping other writers.
43
+ `minimal` template unless the user explicitly requests `empty`. The CLI equivalent
44
+ is `"${mara_cli[@]}" --project /absolute/project --format json project init`.
45
+ Do not create or modify `AGENTS.md` as part of Mara onboarding.
46
+
47
+ ## Choose the operation
48
+
49
+ CLI entries below follow `"${mara_cli[@]}" --project /absolute/project --format json`;
50
+ inspect `<object> <operation> --help` for positional arguments and options.
51
+
52
+ | Intent | MCP operation | CLI command |
53
+ |---|---|---|
54
+ | Discover vocabulary and field/edge constraints | `schema_list`, then `schema_get`; omit kind/name for the full schema | `schema list`, `schema get` |
55
+ | Find items by text or enumerate exact filters | `item_search` or `item_list` | `item search`, `item list` |
56
+ | Read selected items, metadata, and direct relations | `item_get` | `item get` |
57
+ | Inspect direct neighbours, then fetch selected bodies | `item_related`, then `item_get` | `item related`, then `item get` |
58
+ | Create an item, optionally with initial edges | `item_create` | `item create` |
59
+ | Change title, custom fields, or body | `item_update` | `item update` |
60
+ | Relocate an item; preserve ID and MID | `item_move` | `item move` |
61
+ | Change human ID and supported references; preserve MID | `item_rename` | `item rename` |
62
+ | Add or remove an existing item's typed edge | `relation_add` or `relation_remove` | `relation add`, `relation remove` |
63
+ | Delete an item; resolve reported relation/mention blockers | `item_delete` | `item delete` |
64
+ | Check an item or whole-project integrity | `item_validate` or `project_validate` | `item validate`, `project validate` |
65
+
66
+ Use mutations only when the user has asked to change project knowledge. Choose
67
+ the structured mutation for the semantic change. An invalid-argument error calls
68
+ for correcting the input or selecting the right operation; it is not a reason
69
+ to bypass validation by editing source lines. Mara source files remain canonical;
70
+ MCP results are not a separate authoring store.
71
+
72
+ ## Retrieve enough context
73
+
74
+ For example, search with `{"query":"recovery","limit":5}`, select an ID from
75
+ the results, and pass it to `item_get` and `item_related` as `id`. Use the project
76
+ context selected above. Use `excerpts:true` on search when matching passages
77
+ help selection; excerpts may skip content and do not replace an item read.
78
+
79
+ Search, list, related, and get return `has_more` and `next_cursor`. When requested
80
+ content is incomplete, repeat the same operation with that opaque `cursor`,
81
+ keeping project, handle/query, filters, limit, and excerpt options unchanged.
82
+ Continue until the needed content is retrieved; full enumeration/read requires
83
+ `has_more:false`. Get can split body, metadata values, and relations across pages:
84
+ use their byte/index ranges to reconstruct content, including complete titles.
85
+ Restart without a cursor after source/schema changes. Related follows only direct
86
+ edges; choose further neighbours explicitly.
87
+
88
+ CLI retrieval uses the same JSON result fields: for example,
89
+ `"${mara_cli[@]}" --project /absolute/project --format json item search recovery --limit 5`.
90
+ Use `--cursor '<next_cursor>'` for continuation and `--excerpts` for passages.
91
+
92
+ ## Keep metadata inputs distinct
93
+
94
+ Call `schema_get` before authoring unfamiliar flavours, fields, or relations.
95
+ The shared `:key: value` source syntax does not make these interchangeable:
96
+
97
+ - **Structural metadata:** pass title through `title`. Mara generates the
98
+ immutable MID; never supply, copy, or edit it. Creation `id` is a new human ID.
99
+ - **Custom fields:** use `fields:[{"key":"...","value":"..."}]` only for
100
+ fields declared on that flavour. Supply required fields; repeat keys only
101
+ when allowed. Update replaces all values of each supplied key; use
102
+ `clear_fields` to remove optional keys. Omitted update values stay unchanged.
103
+ - **Typed relations:** `justifies` and `satisfies` are relations, not custom
104
+ fields. `fields:[{"key":"justifies","value":"REQ-EXAMPLE"}]` is invalid.
105
+ Use creation `relations` or explicit relation operations; inspect allowed
106
+ source/target flavours first. Incoming backlinks are derived, never authored.
107
+
108
+ CLI equivalents are `--title`, repeatable `--field KEY=VALUE`, update
109
+ `--clear-field KEY`, and creation `--relation NAME=TARGET`. Never pass a relation
110
+ through `--field`. CLI `--body -` reads stdin; MCP `body` is literal text.
111
+
112
+ ## Author and verify
113
+
114
+ 1. Inspect the schema and resolve existing targets with `item_get`. In this
115
+ example, the schema permits `decision` → `justifies` → `requirement`, and
116
+ `REQ-EXAMPLE` already exists. Replace `/absolute/project` with the selected root,
117
+ or omit `project` when the server is bound to it.
118
+ 2. Call `item_create` with a meaningful body and any required custom fields:
119
+
120
+ ```json
121
+ {
122
+ "project": "/absolute/project",
123
+ "flavour": "decision",
124
+ "id": "ADR-EXAMPLE",
125
+ "file": "decisions.mara.md",
126
+ "title": "Keep edits recoverable",
127
+ "body": "Preserve the previous content until validation succeeds so rejected edits can be retried."
128
+ }
129
+ ```
130
+
131
+ 3. Check `complete` and `missing`; a blank required body creates an incomplete
132
+ scaffold. Fill it with `item_update` before claiming completion.
133
+ 4. Call `relation_add` to add the edge:
134
+
135
+ ```json
136
+ {
137
+ "project": "/absolute/project",
138
+ "source": "ADR-EXAMPLE",
139
+ "relation": "justifies",
140
+ "target": "REQ-EXAMPLE"
141
+ }
142
+ ```
143
+
144
+ When initial edges are already known, prefer adding
145
+ `"relations":[{"relation":"justifies","target":"REQ-EXAMPLE"}]` to step 2
146
+ instead of step 4. Creation validates and publishes the item and initial edges
147
+ atomically, rejecting the whole request if an edge is invalid. Targets accept
148
+ exact human IDs or MIDs. Do not add the same edge again; use `relation_add` and
149
+ `relation_remove` for later changes (both take `source`, `relation`, `target`).
150
+
151
+ 5. Call `item_get` with `id:"ADR-EXAMPLE"`; inspect generated MID, title, body,
152
+ custom metadata, and outgoing relations. Call `item_related` with
153
+ `id:"ADR-EXAMPLE",direction:"outgoing"`, then with
154
+ `id:"REQ-EXAMPLE",direction:"incoming"` to verify both views of the edge.
155
+ 6. Call `item_validate` with `id:"ADR-EXAMPLE"`; use `project_validate` for
156
+ corpus-wide integrity after relation or reference changes. Use the same project
157
+ context. Require `valid:true`, not just successful transport. Project
158
+ validation `paths` filters reported diagnostics, not whole-project validity.
159
+
160
+ Update warnings about existing scaffold bodies still count as errors in explicit
161
+ validation. Pending transactions block mutations; use `project_transaction_rollback`
162
+ (`project transaction rollback` in CLI) for explicit recovery after stopping
163
+ other writers.
164
+
165
+ For the same authoring workflow through CLI, after resolving `mara_cli` and
166
+ `REQ-EXAMPLE`, use initial relations atomically when the selected version supports
167
+ `--relation`, and inspect both directions:
168
+
169
+ ```bash
170
+ mara_project=/absolute/project
171
+ "${mara_cli[@]}" --project "$mara_project" --format json schema get
172
+ "${mara_cli[@]}" --project "$mara_project" --format json item get REQ-EXAMPLE
173
+ "${mara_cli[@]}" --project "$mara_project" --format json item create decision ADR-EXAMPLE decisions.mara.md \
174
+ --title 'Keep edits recoverable' \
175
+ --body 'Preserve the previous content until validation succeeds so rejected edits can be retried.' \
176
+ --relation justifies=REQ-EXAMPLE
177
+ "${mara_cli[@]}" --project "$mara_project" --format json item get ADR-EXAMPLE
178
+ "${mara_cli[@]}" --project "$mara_project" --format json item related ADR-EXAMPLE --direction outgoing
179
+ "${mara_cli[@]}" --project "$mara_project" --format json item related REQ-EXAMPLE --direction incoming
180
+ "${mara_cli[@]}" --project "$mara_project" --format json project validate
181
+ ```
182
+
183
+ If the selected version lacks initial relations, or to use separate create/add,
184
+ omit `--relation` during creation and then run
185
+ `relation add ADR-EXAMPLE justifies REQ-EXAMPLE` with the same launcher and global
186
+ project/JSON options. Check creation completeness and validation results as above.