metheus-governance-mcp-cli 0.2.46 → 0.2.48

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.
Files changed (3) hide show
  1. package/README.md +12 -14
  2. package/cli.mjs +10 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -50,17 +50,10 @@ Gemini CLI note:
50
50
  - `gemini mcp` commands require Gemini auth to be configured first (`GEMINI_API_KEY` or `~/.gemini/settings.json` auth).
51
51
  - `setup` registers Gemini in both `user` and `project` scopes to improve auto-discovery across folders.
52
52
 
53
- When a client does not send workspace metadata (for example some Codex sessions),
54
- set a stable fallback root once:
55
-
56
- ```bash
57
- metheus-governance-mcp-cli setup --project-id <project_uuid> --ctxpack-key "<ctxpack_key>" --base-url https://metheus.gesiaplatform.com --workspace-dir auto --workspace-fallback-dir C:\code_test
58
- ```
59
-
60
- This sets fallback workspace context for clients that do not pass workspace metadata:
61
- - Codex/Antigravity/Cursor: `METHEUS_WORKSPACE_DIR` env
62
- - Gemini: pinned `--workspace-dir <fallback>` and `METHEUS_WORKSPACE_DIR` in MCP registration
63
- - fallback env is used only when workspace cannot be resolved (or resolves to home); when current `cwd` is a real project folder, sync uses that folder.
53
+ Workspace signal guardrail:
54
+ - default recommendation is `--workspace-dir auto` with no fixed fallback path.
55
+ - if a client session does not provide trusted workspace signals (`workspaceFolders` / `rootUri` / `cwd`), ctxpack local write is blocked (`sync_status=guarded`, `local_file_count=0`).
56
+ - use `--workspace-fallback-dir` only when you intentionally want a shared fallback root.
64
57
 
65
58
  Guardrail note:
66
59
  - By default, CLI blocks reading/writing ctxpack sync metadata when workspace root resolves to the home directory.
@@ -105,8 +98,8 @@ Cursor note:
105
98
 
106
99
  Tool naming compatibility:
107
100
  - Claude/Codex/Gemini keep canonical MCP tool names (`project.summary`, `ctxpack.merge.brief`, ...).
108
- - Cursor/Antigravity sessions may receive safe aliases (`project_summary`, `ctxpack_merge_brief`, ...).
109
- - Proxy maps alias calls back to canonical names automatically.
101
+ - Cursor/Antigravity sessions use safe aliases only (`project_summary`, `ctxpack_merge_brief`, ...).
102
+ - Proxy maps safe alias calls back to canonical names automatically.
110
103
 
111
104
  Local bootstrap tools exposed by proxy:
112
105
 
@@ -127,7 +120,12 @@ These tools accept `project_id` and return:
127
120
  - same version -> keep current
128
121
  - newer server version -> update local cache
129
122
  - workspace path -> auto-detected from client metadata/env by default
130
- - use `--workspace-fallback-dir <path>` when client metadata is unavailable
123
+ - if workspace signal is missing in auto mode, sync is guarded (no local write)
124
+ - use `--workspace-fallback-dir <path>` only when you intentionally want fallback writes
125
+
126
+ Project-ID first-call rule:
127
+ - when user gives only `Project ID`, call `project.summary` first.
128
+ - call `ctxpack.ensure` after `project.summary` only when extra ctxpack refresh/export context is needed.
131
129
 
132
130
  Ctxpack merge safety flow:
133
131
  - call `ctxpack.merge.brief` first
package/cli.mjs CHANGED
@@ -3719,6 +3719,7 @@ function appendProjectHintToInitialize(responseObj, args, options = {}) {
3719
3719
  const projectSummaryTool = displayToolNameForClient("project.summary", useSafeToolAliases);
3720
3720
  const projectDescribeTool = displayToolNameForClient("project.describe", useSafeToolAliases);
3721
3721
  const projectGetTool = displayToolNameForClient("project.get", useSafeToolAliases);
3722
+ const ctxpackEnsureTool = displayToolNameForClient("ctxpack.ensure", useSafeToolAliases);
3722
3723
  const ctxpackMergeBriefTool = displayToolNameForClient("ctxpack.merge.brief", useSafeToolAliases);
3723
3724
  const ctxpackMergeExecuteTool = displayToolNameForClient("ctxpack.merge.execute", useSafeToolAliases);
3724
3725
  const hintLines = [
@@ -3730,6 +3731,8 @@ function appendProjectHintToInitialize(responseObj, args, options = {}) {
3730
3731
  : []),
3731
3732
  `- MUST call \`${projectSummaryTool}\` first when the user provides only a Project ID or asks project overview/agenda.`,
3732
3733
  `- \`${projectDescribeTool}\` and \`${projectGetTool}\` are aliases of \`${projectSummaryTool}\`.`,
3734
+ `- Never handle a bare Project ID by local file/transcript search before \`${projectSummaryTool}\` succeeds.`,
3735
+ `- Run \`${ctxpackEnsureTool}\` only after \`${projectSummaryTool}\`, and only when additional ctxpack refresh/export context is needed.`,
3733
3736
  "- After project summary, use workitem/evidence/decision tools as follow-up.",
3734
3737
  `- Before any ctxpack merge, call \`${ctxpackMergeBriefTool}\` first, share recommendation to owner, get explicit owner confirmation, then call \`${ctxpackMergeExecuteTool}\`.`,
3735
3738
  "- IMPORTANT: When calling ANY tool, always include your current working directory / project folder path as the `workspace_dir` argument. This enables ctxpack files to be synced to the correct workspace location.",
@@ -3738,7 +3741,13 @@ function appendProjectHintToInitialize(responseObj, args, options = {}) {
3738
3741
  hintLines.splice(1, 0, `- Default project_id is ${args.projectID}.`);
3739
3742
  }
3740
3743
  const hint = `${hintLines.join("\n")}\n`;
3741
- const current = String(result.instructions || "").trimEnd();
3744
+ let current = String(result.instructions || "").trimEnd();
3745
+ if (current) {
3746
+ current = current.replace(
3747
+ /If a user provides only Project ID,\s*call ctxpack\.ensure first[^.\n]*[.\n]?/gi,
3748
+ `If a user provides only Project ID, call ${projectSummaryTool} first. Then call ${ctxpackEnsureTool} only if additional ctxpack refresh is needed.\n`,
3749
+ );
3750
+ }
3742
3751
  result.instructions = current ? `${hint}\n${current}` : hint;
3743
3752
  responseObj.result = result;
3744
3753
  return responseObj;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "metheus-governance-mcp-cli",
3
- "version": "0.2.46",
3
+ "version": "0.2.48",
4
4
  "description": "Metheus Governance MCP CLI (setup + stdio proxy)",
5
5
  "type": "module",
6
6
  "files": [