Skip to content

chore: bump plugin version to 0.2.0 - #12

Merged
pablospe merged 1 commit into
mainfrom
plugin-version
Apr 2, 2026
Merged

pablospe merged 1 commit into
mainfrom
plugin-version

Conversation

@pablospe

@pablospe pablospe commented Apr 2, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Update .claude-plugin/plugin.json version from 0.1.1 to 0.2.0 to match the release.

Summary by CodeRabbit

  • Chores
    • Updated plugin version to 0.2.0

@coderabbitai

coderabbitai Bot commented Apr 2, 2026 •

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2e0dd39e-77c2-48ea-9f8a-b1a77d065db5

📥 Commits

Reviewing files that changed from the base of the PR and between a2dcbf3 and 0304bab.

📒 Files selected for processing (1)
  • .claude-plugin/plugin.json

📝 Walkthrough

Walkthrough

The plugin manifest version in .claude-plugin/plugin.json has been incremented from 0.1.1 to 0.2.0, marking a minor version release. This is a configuration-only change with no modifications to plugin functionality or behavior.

Changes

Cohort / File(s) Summary
Plugin Manifest Version Bump
.claude-plugin/plugin.json
Version field updated from 0.1.1 to 0.2.0 to reflect a minor version release.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Poem

🐰 A version bump, so clean and neat,
From point-one-one to point-two sweet!
The manifest shines with numbers new,
A rabbit's hop to 0.2.0 — hop on through! 🎉

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch plugin-version

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 and usage tips.

@pablospe
pablospe merged commit 8a38411 into main Apr 2, 2026
7 of 8 checks passed
@codecov

codecov Bot commented Apr 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.7%. Comparing base (cb61a1d) to head (0304bab).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##            main     #12     +/-   ##
=======================================
+ Coverage   93.5%   93.7%   +0.2%     
=======================================
  Files         10      10             
  Lines       1867    1993    +126     
  Branches     433     458     +25     
=======================================
+ Hits        1746    1869    +123     
+ Misses        33      31      -2     
- Partials      88      93      +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pablospe
pablospe deleted the plugin-version branch April 2, 2026 12:18
pablospe added a commit that referenced this pull request Jul 13, 2026
* feat: move workspace to platform cache directory (#12)

The per-document workspace previously lived in a .docx/<stem>/ folder next
to the source file, cluttering user directories and risking collisions
between same-named documents.

It now lives under the platform user cache, in docx-editor/<hash>/ where
<hash> is sha256 of the document's absolute path:

  Linux    $XDG_CACHE_HOME/docx-editor (fallback ~/.cache/docx-editor)
  macOS    ~/Library/Caches/docx-editor
  Windows  %LOCALAPPDATA%\docx-editor (fallback ~/AppData/Local)

The base directory can be overridden, in precedence order, by the
workspace_dir argument to Document.open()/Workspace(), the
DOCX_EDITOR_WORKSPACE_DIR environment variable, or the platform default.
A relative override resolves against the source document's directory, so
workspace_dir=".docx" reproduces the old next-to-file layout for debugging.

Path resolution is centralized in Workspace._resolve_workspace_path(),
replacing the duplicated logic in __init__, exists(), and delete(). Base
directory cleanup suppresses OSError, since the base is now shared across
documents and processes.

No auto-migration: workspaces created by older versions are not found, and
leftover .docx/ folders can be deleted.

* fix: harden workspace cache path resolution and cleanup

Follow-up to the cache migration, from a multi-reviewer pass.

Crash: the workspace dir was keyed by sha256(str(path).encode()), but
str(Path) carries undecodable filename bytes as surrogates, which strict
UTF-8 rejects. Opening e.g. "café.docx" (latin-1 on disk) raised
UnicodeEncodeError. Hash via os.fsencode(os.path.normcase(path)) instead;
this is byte-identical for all decodable paths, so no workspace moves.
normcase also folds case on Windows, where one file could otherwise map to
two workspaces.

Data loss: close()/delete() removed the base directory when it was left
empty. That was safe when the base was the library's own .docx/ folder, but
the base is now the shared cache root -- or whatever directory the caller
passed via workspace_dir=/DOCX_EDITOR_WORKSPACE_DIR. The library was
deleting a directory it did not create. It now removes only the document's
own workspace folder. Two tests asserted the old behavior and are rewritten.

Path resolution: overrides are now tilde-expanded (DOCX_EDITOR_WORKSPACE_DIR
=~/ws created a literal "~" directory next to each document), an empty or
whitespace override counts as unset and falls through to the next precedence
level (workspace_dir="" silently rebased onto the document's own directory),
and a relative XDG_CACHE_HOME/%LOCALAPPDATA% is ignored per the XDG spec
rather than scattering caches beside every document.

Permissions: the workspace holds the document's plaintext in a shared,
predictably-named cache, so it and its base are created 0o700 instead of
inheriting a 0o775 umask default. mkdir(parents=True, mode=) applies the
mode to the leaf only, so the base is created explicitly.

Provenance: a workspace whose meta.json names a different source document is
now refused instead of silently adopted -- adopting it would let a later
save() pack that other document's XML over this one's source file.

Errors: filesystem failures at the new cache boundary (unwritable base, no
resolvable home) surfaced as raw PermissionError/RuntimeError out of
Document.open(). They are now WorkspaceError, naming the override to set.

Also: add a public Document.workspace_path -- the docs told users to inspect
the preserved workspace but gave them no way to locate it now that it is an
opaque hash under the cache. Drop the write-only self.workspace_dir, hoist
the function-local shutil import, and correct the "unsaved edits in the
workspace" wording (edits reach the workspace only on save()).

* fix: correct three regressions in the workspace hardening

Found by a second adversarial pass over the previous commit.

The permissions test guarded itself with skipif(os.getuid() == 0). A skipif
condition is evaluated at collection time on every platform, and os.getuid
does not exist on Windows, so the whole test module would die on import there
-- taking with it the two tests that exist specifically to cover the Windows
cache dir. Guard on os.name first; `or` short-circuits before os.geteuid.

The provenance check compared the raw source path while the workspace key is
normcase-folded. On a case-insensitive filesystem two spellings map to one
workspace directory, which the check would then reject as "a different
document" -- and the message tells the user to pass force_recreate=True,
which would rmtree the workspace. Fold both sides the same way.

Stripping the override with str(override).strip() also stripped Path inputs,
silently redirecting a path that legitimately ends in whitespace to a
different directory. Strip str overrides (where stray whitespace is config
noise) and take a Path verbatim.

Also document the WorkspaceError exits that the hardening added to
Document.open(), and drop the literal ~ from the workspace_path example --
the value is always expanded.
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