Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,8 @@ Routing rules receive a tool's original arguments unchanged. Resource reads and
Policies classify operations as `read`, `write`, or `destructive` in this order:

1. an exact local `tooling.toolRiskOverrides` entry;
2. MCP tool annotations only when that exact base `upstream` or named `upstreams.<name>` declaration sets `trustToolAnnotations: true`;
3. Miftah's fixed PostHog command adapter, only for an `exec` tool on the canonical official Streamable HTTP endpoint `https://mcp.posthog.com/mcp` (the version-1 `http` compatibility alias is equivalent);
2. Miftah's fixed PostHog command adapter, only for an `exec` tool on the canonical official Streamable HTTP endpoint `https://mcp.posthog.com/mcp` (the version-1 `http` compatibility alias is equivalent);
3. MCP tool annotations only when that exact base `upstream` or named `upstreams.<name>` declaration sets `trustToolAnnotations: true`;
4. conservative name heuristics; then
5. `tooling.unknownToolRisk`, which defaults to `"destructive"` and may be set only to `"write"` or `"destructive"`.

Expand Down
1 change: 1 addition & 0 deletions tests/release-version.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ describe("v0.3.2 release artifacts", () => {
expect(changelog).toContain("Miftah is experimental and pre-1.0");
expect(notes).toContain("### Fixed");
expect(notes).toMatch(/PostHog command-wrapper grammar/iu);
expect(notes).toMatch(/trusted PostHog command metadata.*generic static annotations/iu);
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
expect(notes).toMatch(/upstream process containment/iu);
expect(notes).toMatch(/esbuild.*0\.28\.1/iu);
const readme = readRepositoryFile("README.md");
Expand Down
18 changes: 18 additions & 0 deletions tests/risk-classification-docs-contract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,22 @@ describe("risk classification documentation contract", () => {
expect(libraryApi).toContain("UnknownToolRisk");
expect(changelog).toMatch(changelogRiskClassificationPattern);
});

it("keeps the documented classification precedence aligned with the runtime", () => {
const config = readRepositoryFile("docs/config.md");
const precedence = [
"1. an exact local `tooling.toolRiskOverrides` entry;",
"2. Miftah's fixed PostHog command adapter",
"3. MCP tool annotations only when",
"4. conservative name heuristics; then",
"5. `tooling.unknownToolRisk`"
];

let previousIndex = -1;
for (const step of precedence) {
const currentIndex = config.indexOf(step);
expect(currentIndex, `missing or out-of-order documentation step: ${step}`).toBeGreaterThan(previousIndex);
previousIndex = currentIndex;
}
});
});