Skip to content

Document TOML 1.1 config parsing and tighten parse-error coverage - #9846

Merged
lpcox merged 3 commits into
mainfrom
copilot/go-fan-review-burntsushi-toml
Jul 22, 2026
Merged

Document TOML 1.1 config parsing and tighten parse-error coverage#9846
lpcox merged 3 commits into
mainfrom
copilot/go-fan-review-burntsushi-toml

Conversation

Copilot AI commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

github.com/BurntSushi/toml is already current and used appropriately in the config loader, but the user-facing config docs did not explicitly call out the TOML 1.1 parsing contract. This change makes that contract visible in the main config references and strengthens the existing parse-error test path to assert populated line/column metadata.

  • Docs: make the TOML contract explicit

    • Add a TOML 1.1 note to docs/CONFIGURATION.md
    • Add the same note to config.example.toml
    • Clarify that external validators/editors should be TOML 1.1-compatible
  • Tests: cover parse-error position metadata on the formatting path

    • Extend the existing FormatConfigError test to assert the wrapped toml.ParseError includes non-zero Position.Line and Position.Col
    • Keep the test focused on the existing error-reporting path rather than introducing new behavior
  • Example

    var perr toml.ParseError
    require.ErrorAs(t, err, &perr)
    assert.Greater(t, perr.Position.Line, 0)
    assert.Greater(t, perr.Position.Col, 0)

Copilot AI linked an issue Jul 22, 2026 that may be closed by this pull request
4 tasks
Copilot AI changed the title [WIP] Review Go module BurntSushi/toml for usage Document TOML 1.1 config parsing and tighten parse-error coverage Jul 22, 2026
Copilot finished work on behalf of lpcox July 22, 2026 22:06
Copilot AI requested a review from lpcox July 22, 2026 22:06
@lpcox
lpcox marked this pull request as ready for review July 22, 2026 22:18
Copilot AI review requested due to automatic review settings July 22, 2026 22:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Documents the TOML 1.1 parsing contract and strengthens parse-error metadata coverage.

Changes:

  • Documents TOML 1.1 compatibility requirements.
  • Verifies parse errors contain line and column metadata.
Show a summary per file
File Description
docs/CONFIGURATION.md Documents the TOML parsing contract.
config.example.toml Adds compatibility guidance.
internal/config/config_core_test.go Extends parse-error assertions.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Medium

Comment thread docs/CONFIGURATION.md Outdated
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

🔒 mcpg Read-Only Stress — default AWF

Surface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Isolation runtime: default AWF (normal container isolation)

Part Surface Op Result Expected Status
A MCP reads (list_issues/list_PRs/get_file/list_commits) data returned ALLOWED
B MCP writes (reaction/star/issue/comment/branch/file/PR) gateway Error[-32602] unknown tool BLOCKED
C CLI reads (list_issues/get_file) data returned ALLOWED
D CLI REST writes (reaction/star/issue/comment/file) gh unauthenticated BLOCKED
E CLI GraphQL mutations (addReaction/addStar/createIssue) gh unauthenticated BLOCKED

Overall: PASS

B-surface note: All 7 MCP write tools returned Error [-32602]: unknown tool from the gateway in <40ms (vs ~1500ms for reads), confirming the gateway rejects writes before forwarding.

References: §29965985681

🔒 mcpg read-only stress (default AWF runtime) by Read-Only Stress: default runtime

@github-actions

Copy link
Copy Markdown
Contributor

🔒 mcpg Read-Only Stress — docker-sbx

Surface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Isolation runtime: docker-sbx (KVM-isolated microVM)

Part Surface Op Result Expected Status
A MCP reads (issues/PRs/file/commits) data returned ALLOWED
B MCP writes (reaction/star/issue/comment/branch/file/PR) gateway refused (Error[-32602] unknown tool, ~14ms) BLOCKED
C CLI reads (list_issues, get_file_contents) data returned ALLOWED
D CLI REST writes (reaction/star/issue/comment/file) refused (gh unauthenticated) BLOCKED
E CLI GraphQL mutations (addReaction/addStar/createIssue) refused (gh unauthenticated) BLOCKED

Overall: PASS

Part B note: Gateway enforcement confirmed via response latency — reads forwarded to backend take ~1200ms; write tool blocks return ~14ms directly from the gateway. The gateway strips write tools from the exposed MCP toolset and returns Error[-32602]: unknown tool for any write attempt.

References: §29965985665

🔒 mcpg read-only stress (docker-sbx runtime) by Read-Only Stress: docker-sbx runtime

@github-actions

Copy link
Copy Markdown
Contributor

🔒 mcpg Read-Only Stress — gVisor

Surface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Isolation runtime: gVisor (runsc) kernel-level isolation

Part Surface Op Result Expected Status
A MCP reads (issues/PRs/file/commits) data returned ALLOWED
B MCP writes (reaction/star/issue/comment/branch/file/PR) Error [-32602]: unknown tool (gateway blocks) BLOCKED
C CLI reads (issues/file via github CLI) data returned ALLOWED
D CLI REST writes (reaction/star/issue/comment/file) gh unauthenticated — no GH_TOKEN BLOCKED
E CLI GraphQL mutations (addReaction/addStar/createIssue) gh unauthenticated — no GH_TOKEN BLOCKED

Overall: PASS

Part B detail: All 7 write tools returned MCP [-32602]: unknown tool — gateway enforces read-only by excluding write tools from its registry.
Parts D & E: gh CLI unauthenticated in this sandbox; all REST/GraphQL writes fail at auth.

Run: §29965985672

🔒 mcpg read-only stress (gVisor runtime) by Read-Only Stress: gVisor runtime

@lpcox
lpcox merged commit 443c035 into main Jul 22, 2026
44 of 46 checks passed
@lpcox
lpcox deleted the copilot/go-fan-review-burntsushi-toml branch July 22, 2026 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[go-fan] Go Module Review: BurntSushi/toml

3 participants