Skip to content

fix(mongodb-mcp): add BsonFieldType enum to Zig FFI (standards#155) - #119

Merged
hyperpolymath merged 2 commits into
mainfrom
fix/mongodb-mcp-bsonfieldtype
May 20, 2026
Merged

fix(mongodb-mcp): add BsonFieldType enum to Zig FFI (standards#155)#119
hyperpolymath merged 2 commits into
mainfrom
fix/mongodb-mcp-bsonfieldtype

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

Class C ABI gap from the Phase 2 full-tree survey (standards#92):
MongodbMcp.SafeDatabase.BsonFieldType (11 BSON wire-protocol field
types) was declared in the Idris2 ABI but absent from
mongodb_mcp_ffi.zig. Adds the matching pub const BsonFieldType = enum(c_int) with the canonical encoding (1–18 with BSON-spec gaps).

ABI parity only — the wire-protocol encoder/decoder that uses these
tags is a separate piece of work; declaring the enum here lets
iseriser abi-verify structurally check the encoding.

Verified

  • iseriser abi-verify → exit 0 (3 enums clean)
  • zig build test → 17/17 green

Next

After merge, mongodb-mcp can join the abi-drift allowlist
(boj-server#115's 56 → 57).

Closes hyperpolymath/standards#155
Refs hyperpolymath/standards#92
Refs hyperpolymath/standards#89

🤖 Generated with Claude Code

Closes the Class C ABI gap surfaced by the Phase 2 full-tree survey:
`MongodbMcp.SafeDatabase.BsonFieldType` (11 BSON wire-protocol field
types with explicit `bsonFieldTypeToInt` encoding 1–18 with gaps at
6, 11–15, 17 per the BSON spec) was declared in the Idris2 ABI but
absent from `mongodb_mcp_ffi.zig`. Adds the matching
`pub const BsonFieldType = enum(c_int)` with the same encoding.

Scope is ABI parity only. The wire-protocol encoder/decoder that
*uses* these tags is a separate piece of work — declaring the enum
here lets `iseriser abi-verify` structurally check the encoding
against the Idris2 source, and unblocks mongodb-mcp for the
boj-server abi-drift allowlist.

## Verified

```
$ iseriser abi-emit-manifest --idris cartridges/mongodb-mcp/abi/MongodbMcp/SafeDatabase.idr \
    --cartridge mongodb-mcp --source-path … --out /tmp/m.json
abi-emit-manifest: wrote /tmp/m.json (3 enums, 0 transitions)

$ iseriser abi-verify --manifest /tmp/m.json \
    --zig-ffi cartridges/mongodb-mcp/ffi/mongodb_mcp_ffi.zig
abi-verify: OK — cartridge `mongodb-mcp` ABI manifest agrees with `…/mongodb_mcp_ffi.zig`
exit=0
```

`zig build test` 17/17 green.

After merge, mongodb-mcp can join the abi-drift allowlist (currently
56 cartridges per boj-server#115).

Closes hyperpolymath/standards#155
Refs hyperpolymath/standards#92
Refs hyperpolymath/standards#89

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 30 issues detected

Severity Count
🔴 Critical 18
🟠 High 5
🟡 Medium 7

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "reason": "Stale AI session file -- delete",
    "type": "stale",
    "file": "GEMINI.md",
    "action": "delete",
    "rule_module": "root_hygiene",
    "severity": "medium"
  },
  {
    "reason": "Issue in quality.yml",
    "type": "missing_workflow",
    "file": "quality.yml",
    "action": "create",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Issue in security-policy.yml",
    "type": "missing_workflow",
    "file": "security-policy.yml",
    "action": "create",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action hyperpolymath/standards/.github/workflows/governance-reusable.yml@main needs attention",
    "type": "unpinned_action",
    "file": "governance.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/boj-server/boj-server/cartridges/sanctify-mcp/adapter/mod.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/boj-server/boj-server/cartridges/academic-workflow-mcp/adapter/mod.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/boj-server/boj-server/cartridges/fireflag-mcp/adapter/mod.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/boj-server/boj-server/cartridges/ephapax-mcp/adapter/mod.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/boj-server/boj-server/cartridges/bofig-mcp/adapter/mod.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/boj-server/boj-server/cartridges/hesiod-mcp/adapter/mod.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

@hyperpolymath
hyperpolymath merged commit a60b942 into main May 20, 2026
17 of 22 checks passed
@hyperpolymath
hyperpolymath deleted the fix/mongodb-mcp-bsonfieldtype branch May 20, 2026 09:01
@github-actions

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 30 issues detected

Severity Count
🔴 Critical 18
🟠 High 5
🟡 Medium 7

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "reason": "Stale AI session file -- delete",
    "type": "stale",
    "file": "GEMINI.md",
    "action": "delete",
    "rule_module": "root_hygiene",
    "severity": "medium"
  },
  {
    "reason": "Issue in quality.yml",
    "type": "missing_workflow",
    "file": "quality.yml",
    "action": "create",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Issue in security-policy.yml",
    "type": "missing_workflow",
    "file": "security-policy.yml",
    "action": "create",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action hyperpolymath/standards/.github/workflows/governance-reusable.yml@main needs attention",
    "type": "unpinned_action",
    "file": "governance.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/boj-server/boj-server/cartridges/sanctify-mcp/adapter/mod.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/boj-server/boj-server/cartridges/academic-workflow-mcp/adapter/mod.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/boj-server/boj-server/cartridges/fireflag-mcp/adapter/mod.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/boj-server/boj-server/cartridges/ephapax-mcp/adapter/mod.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/boj-server/boj-server/cartridges/bofig-mcp/adapter/mod.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/boj-server/boj-server/cartridges/hesiod-mcp/adapter/mod.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[#92 Class C] mongodb-mcp: missing BsonFieldType enum in Zig FFI

1 participant