8000 feat(orient): 0006 StateManifestOrientation — orient_workspace v1 by Ryan-AI-Studios · Pull Request #36 · gimp-mcp/gimp-mcp · GitHub
[go: up one dir, main page]

Skip to content

feat(orient): 0006 StateManifestOrientation — orient_workspace v1 - #36

Closed
Ryan-AI-Studios wants to merge 13 commits into
gimp-mcp:mainfrom
Ryan-AI-Studios:feature/0006-state-manifest-orientation
Closed

Ryan-AI-Studios wants to merge 13 commits into
gimp-mcp:mainfrom
Ryan-AI-Studios:feature/0006-state-manifest-orientation

Conversation

@Ryan-AI-Studios
@Ryan-AI-Studios Ryan-AI-Studios commented Aug 2, 2026 •
Copy link
Copy Markdown

Summary

Track 0006-StateManifestOrientation: agents get a schema-versioned, read-only workspace model before mutation.

  • New orient_workspace MCP tool → state-manifest v1.0.0 (urn:gimp-agent:state-manifest:1)
  • Host module gimp_mcp_state.py: provisional handles, recursive validate_manifest, honest capabilities, finalize_manifest (transport stdio-proxy)
  • Schema artifact schemas/state-manifest.v1.json
  • Plugin raw dump: recursive layer tree via _layer_children, kinds via isinstance/gtype, selection, color profile, EXIF fields, session_id/epoch on plugin instance
  • selected uses displays[0] only (never index-0 default when no displays)
  • summary_only + image_index for large workspaces
  • Hygiene: get_image_metadata(image_index) three coordinated edits
  • Depth/visited guards on full tree, summary count, and _iter_layers_recursive
  • Offline tests (23 track tests; 155 offline suite green)

Out of scope (as planned)

  • STALE_HANDLE / generation++ → 0007
  • EXIF pixel normalize → 0008
  • Live GIMP matrix → offline waiver + operator checklist in review.md

Review

  • Internal review → fix F1–F6 (offsets, schema required fields, warnings, greps)
  • Codex: prior P1/P2 fixed; engineering PASS WITH DEFERRED P3 (live matrix / governance)

Test plan

  • uv run ruff check .
  • uv run ruff format --check .
  • uv run basedpyright
  • uv run pytest -m \"not integration and not slow\"
  • ledgerful verify --scope full
  • CI green

Summary by CodeRabbit

  • New Features

    • Added authenticated, loopback-secured connections with workspace path protection and gated command execution.
    • Added visible-composite snapshots, regional scaling, image selection, workspace orientation, and state manifests.
    • Added alpha verification and transparent PNG export with structured success and error details.
    • Added GIMP 3.2 compatibility and expanded tool coverage.
  • Documentation

    • Added security guidance, export best practices, installation updates, and comprehensive protocol documentation.
  • Tests

    • Added offline coverage for security, exports, snapshots, state manifests, and quality checks.

Ryan and others added 13 commits August 2, 2026 08:17
Add uv dev toolchain (ruff, basedpyright, pytest), project CI with
Node-24-ready Actions, gitignore for local agent/conductor governance,
offline smoke tests, and docs/planner-handoff.md for cold-start planners.
Includes small gimp_mcp_server typing/format fixes for the new gate.
Document 0001 bootstrap complete, 0002 quality stabilization as next,
and the full path through 0028 final product polish.
Full product ruff/format green; scripts layout; setup-uv@v9.0.0; lint.yml retired; planner-handoff policy.

Ledger: 83598dee-78b5-4c0a-8975-96a7b5cd15c4
…th jail

Track 0003: Class A/B exec gates, AF_INET 127.0.0.1, session auth, path jail, audit. CI green. Codex final PASS WITH DEFERRED P3.
…mapping

Visible composite snapshots (dup+merge), image_index, ToolResult structuredContent mapping, temp policy, fail-closed selection/PNG validation. Codex final PASS WITH DEFERRED P3.
* feat(export): add gimp_mcp_export host module + offline alpha tests

* fix(export): alpha-preserving merge-on-dup + file-*-export + verify tool

* docs: Issue 16 alpha export defaults, install gimp_mcp_export.py

* fix(export): recursive alpha preflight + structured MCP errors

IR1-01: walk layer groups recursively in preflight/verify_alpha
IR1-02: return structured export error dicts from MCP export_image
IR1-04: fail-closed when preserve_alpha and drawable unset
IR1-05: greps, type-4 PNG fixture, structured-error source tests

* fix(export): codex P1/P2 — no silent format fallback, fail-closed RGBA8, batch metadata

* fix(export): format README; drop accidental conductor review from tree

Keep conductor/ gitignored local-only. Ruff-format README code fences for CI.

* docs(0005): mark AlphaExportCorrectness complete in planner handoff

Issue 16 closed: merge-on-dup export, IHDR ALPHA_LOST, verify_alpha_channel.
Next product track: 0006 StateManifestOrientation (placeholder plan).

---------

Co-authored-by: Ryan <rbourgoin@gmail.com>
Introduce schemas/state-manifest.v1.json (draft 2020-12), pure stdlib
gimp_mcp_state.py (handles, normalize, capabilities, recursive validate,
finalize_manifest), and tests/test_state_manifest.py with nested-group
goldens and optional jsonschema checks.

Ledger: f13ebc80-dc77-4722-831e-68b1858c6a0f
Add session_id/epoch/started_at on MCPPlugin.__init__, register
orient_workspace dispatcher, implement read-only recursive state dump
(selected via displays[0], kinds via isinstance/gtype, no flush/undo),
and wire get_image_metadata params through dispatcher + _get_image.

Ledger: f13ebc80-dc77-4722-831e-68b1858c6a0f
Wire server orient_workspace through finalize_manifest (stdio-proxy),
pass image_index on get_image_metadata, update list_layers/protocol/
README for orientation SoT, and harden wiring tests.

Ledger: f13ebc80-dc77-4722-831e-68b1858c6a0f
…arnings)

Ledger: f13ebc80-dc77-4722-831e-68b1858c6a0f
Ledger: f13ebc80-dc77-4722-831e-68b1858c6a0f
- summary_only layer_count: visited ids + _ORIENT_MAX_LAYER_DEPTH
- _iter_layers_recursive: visited set + max_depth=32
- Host validate: source_path required (string|null), selection.bounds ints, captured_at ISO-ish
- Schema: source_path in imageManifest.required; bounds requires x/y/width/height

Ledger: f13ebc80-dc77-4722-831e-68b1858c6a0f
@coderabbitai
coderabbitai Bot commented Aug 2, 2026 •
Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: e3b8a0d5-8c26-4111-a16e-d821547526dc

📥 Commits

Reviewing files that changed from the base of the PR and between 09bfb2d and 9e4dcce.

⛔ Files ignored due to path filters (3)
  • scripts/continuous_edit_test/files/bg_night_2048.png is excluded by !**/*.png
  • scripts/continuous_edit_test/files/winry_joy.png is excluded by !**/*.png
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (30)
  • .github/workflows/ci.yml
  • .github/workflows/lint.yml
  • .gitignore
  • .pre-commit-config.yaml
  • CLAUDE.md
  • GIMP_MCP_PROTOCOL.md
  • README.md
  • SECURITY.md
  • agent_edit_demo.py
  • bg_remove.py
  • bg_remove_iterative.py
  • docs/best_practices.md
  • docs/planner-handoff.md
  • gimp-mcp-plugin.py
  • gimp_mcp_export.py
  • gimp_mcp_security.py
  • gimp_mcp_server.py
  • gimp_mcp_snapshot.py
  • gimp_mcp_state.py
  • pyproject.toml
  • run_tests.py
  • schemas/state-manifest.v1.json
  • scripts/add_text_metadata.py
  • scripts/continuous_edit_test/continuous_edit_test.py
  • tests/test_export_alpha.py
  • tests/test_quality_smoke.py
  • tests/test_security_policy.py
  • tests/test_snapshot_composite.py
  • tests/test_snapshot_mapping.py
  • tests/test_state_manifest.py

Walkthrough

The bridge now uses authenticated loopback transport, workspace path confinement, gated execution, composite snapshots, alpha-aware exports, schema-versioned workspace orientation, structured errors, CI quality checks, and expanded documentation.

Changes

GIMP MCP bridge

Layer / File(s) Summary
Authenticated transport and security policy
gimp_mcp_security.py, gimp-mcp-plugin.py, gimp_mcp_server.py, SECURITY.md, client scripts
Adds token authentication, loopback validation, workspace confinement, audit events, traceback redaction, and disabled-by-default arbitrary execution.
Composite snapshots and image mapping
gimp_mcp_snapshot.py, gimp-mcp-plugin.py, gimp_mcp_server.py, tests/test_snapshot_*.py
Adds visible-composite snapshots with image indexes, regions, scaling, mapping metadata, temporary paths, and PNG validation.
Alpha-aware export
gimp_mcp_export.py, gimp-mcp-plugin.py, gimp_mcp_server.py, tests/test_export_alpha.py, docs/best_practices.md
Adds export policies, alpha detection and verification, duplicate-based preparation, structured errors, and batch-export options.
Workspace orientation manifest
gimp_mcp_state.py, schemas/state-manifest.v1.json, gimp-mcp-plugin.py, gimp_mcp_server.py, tests/test_state_manifest.py
Adds handles, recursive layer manifests, validation, normalization, finalization, and the orient_workspace tool.
Quality tooling and workflows
.github/workflows/ci.yml, pyproject.toml, .pre-commit-config.yaml, tests/test_quality_smoke.py, docs/planner-handoff.md
Adds CI, pinned development tools, Ruff formatting, basedpyright, pytest settings, smoke tests, and repository planning documentation.
Operation and integration updates
gimp-mcp-plugin.py, gimp_mcp_server.py, agent_edit_demo.py, bg_remove*.py, run_tests.py, scripts/*
Migrates editing and integration workflows to authenticated structured commands and explicit execution-status handling.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

Suggested labels: documentation

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Ryan-AI-Studios
Copy link
Copy Markdown
Author

Opened against upstream by mistake — product work lands on Ryan-AI-Studios/gimp-mcp fork first.

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.

1 participant

0